/* ============================================
   CHU VAN AN CONFESSION - School Notebook Style
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Patrick+Hand&family=Inter:wght@400;700&display=swap');

:root {
  --school-bg: #f8f9fa;
  --paper-white: #ffffff;
  --paper-line: #e1e4e8;
  --school-blue: #4a90e2;
  --school-accent: #ff6b6b;
  --school-text: #2d3436;
  --school-text-dim: #636e72;
  --notebook-margin: #ffcfcf;
  --handwritten: 'Patrick Hand', cursive;
}

/* --- Base --- */
.hidden { display: none !important; }

.confession-page * {
  box-sizing: border-box;
}

.confession-page {
  font-family: 'Inter', sans-serif;
  background-color: var(--school-bg);
  background-image: 
    linear-gradient(var(--paper-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--paper-line) 1px, transparent 1px);
  background-size: 20px 20px;
  color: var(--school-text);
  margin: 0;
  min-height: 100vh;
}

/* --- Header --- */
.pixel-header {
  background: white;
  border-bottom: 2px solid var(--school-blue);
  padding: 1rem 2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.pixel-header-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.back-link {
  color: var(--school-blue);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}

.pixel-logo-text {
  font-family: var(--handwritten);
  font-size: 1.5rem;
  color: var(--school-text);
  font-weight: bold;
}

.music-controls {
  display: flex;
  align-items: center;
}

.music-btn {
  background: var(--paper-white);
  border: 2px solid var(--paper-line);
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  font-family: var(--handwritten);
  font-size: 1rem;
}

.music-btn:hover {
  border-color: var(--school-blue);
  background: #f0f7ff;
}

.music-btn.playing {
  background: var(--school-blue);
  color: white;
  border-color: var(--school-blue);
}

.music-icon {
  font-size: 1.2rem;
}

/* --- Main Content --- */
.pixel-main {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* --- Hero Section --- */
.confession-hero {
  text-align: center;
  padding: 3rem 1rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  position: relative;
  overflow: hidden;
  border-left: 20px solid var(--notebook-margin);
}

.confession-hero::before {
  content: '📝';
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 2rem;
  opacity: 0.2;
}

.confession-hero-title {
  font-family: var(--handwritten);
  font-size: 3rem;
  margin: 0;
  color: var(--school-blue);
  line-height: 1.2;
}

.confession-hero-subtitle {
  font-size: 1.2rem;
  color: var(--school-accent);
  margin-top: 0.5rem;
  font-weight: bold;
}

.confession-hero-desc {
  margin-top: 1.5rem;
  color: var(--school-text-dim);
  font-size: 1.1rem;
  line-height: 1.6;
}

/* --- Hearts Decor --- */
.pixel-hearts {
  margin: 1rem 0;
  font-size: 1.5rem;
}

/* --- Form Section --- */
.confession-form-section {
  margin-top: 2rem;
}

.form-frame {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  border: 1px solid #eee;
}

.form-title {
  font-family: var(--handwritten);
  font-size: 1.8rem;
  color: var(--school-text);
  margin-bottom: 0.5rem;
}

.form-subtitle {
  color: var(--school-text-dim);
  margin-bottom: 2rem;
}

.form-frame iframe {
  border-radius: 8px;
  border: 1px solid #ddd;
}

/* --- Game Teaser --- */
.game-teaser {
  margin-top: 3rem;
  text-align: center;
}

.teaser-frame {
  background: #fff9db; /* Sticky note yellow */
  padding: 2rem;
  border-radius: 4px;
  transform: rotate(-1deg);
  box-shadow: 3px 3px 10px rgba(0,0,0,0.1);
  display: inline-block;
  width: 100%;
}

.teaser-title {
  font-family: var(--handwritten);
  font-size: 1.5rem;
  color: #f08c3a;
}

.teaser-desc {
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.arena-cta {
  background: var(--school-blue);
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: bold;
  display: inline-block;
  transition: 0.3s;
}

.arena-cta:hover {
  background: #357abd;
  transform: scale(1.05);
}

/* --- Footer --- */
.pixel-footer {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--school-text-dim);
}

.pixel-footer a {
  color: var(--school-blue);
  text-decoration: none;
}

/* --- Floating Doodles (Replacement for Pixels) --- */
.floating-pixel {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  opacity: 0.15;
  font-size: 24px;
  animation: floatDoodle linear infinite;
}

@keyframes floatDoodle {
  0% { transform: translateY(110vh) rotate(0deg); opacity: 0; }
  10% { opacity: 0.2; }
  90% { opacity: 0.2; }
  100% { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

/* --- School Photo Section --- */
.school-photo-section {
  margin: 2rem 0;
  text-align: center;
}

.school-photo-frame {
  display: inline-block;
  background: white;
  padding: 12px;
  border: 6px solid #ffb6c1; /* Light Pink Border */
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(255,182,193,0.3);
  max-width: 100%;
  transform: rotate(1deg);
  transition: 0.3s;
}

.school-photo-frame:hover {
  transform: rotate(0deg) scale(1.02);
}

.school-photo-frame img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 2px;
}
/* --- Combat Mini Game --- */
.confession-combat-section {
  margin-top: 3rem;
}

.combat-frame {
  background: #2d3436; /* Dark theme for combat */
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  color: white;
  text-align: center;
  border: 4px solid #4a90e2;
}

.combat-title {
  font-family: var(--handwritten);
  font-size: 2.2rem;
  color: #4a90e2;
  margin-bottom: 0.5rem;
}

.combat-subtitle {
  color: #b2bec3;
  margin-bottom: 1.5rem;
}

.combat-container {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.combat-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0 1rem;
}

.stat-group {
  flex: 1;
}

.stat-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: bold;
  margin-bottom: 5px;
  text-align: left;
}

.stat-group:last-child label {
  text-align: right;
}

.health-bar {
  height: 20px;
  background: #444;
  border: 2px solid #666;
  border-radius: 10px;
  overflow: hidden;
}

.health-fill {
  height: 100%;
  background: #2ecc71;
  transition: width 0.3s ease-out;
}

.boss-bar .health-fill {
  background: #e74c3c;
}

.combat-timer {
  font-size: 2rem;
  font-weight: bold;
  margin: 0 2rem;
  color: #f1c40f;
  min-width: 60px;
}

#combatCanvas {
  background: #1e272e;
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  image-rendering: pixelated; /* Essential for pixel art look */
}

.combat-controls-guide {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1rem;
  color: #636e72;
  font-size: 0.9rem;
}

.combat-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  border-radius: 4px;
}

.combat-overlay.hidden {
  display: none;
}

.overlay-content h3 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  font-family: var(--handwritten);
}

@media (max-width: 600px) {
  .combat-stats { flex-direction: column; gap: 0.5rem; }
  .combat-timer { order: -1; }
  .combat-controls-guide { flex-wrap: wrap; gap: 0.5rem; }
}

