* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Poppins', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 10px;
    transition: background-color 0.3s ease;
}
.hidden { display: none !important; }

:root {
    --bg: #FFF8E1; --chip1: #4FC3F7; --chip2: #FFB74D;
    --header-bg: #FFF3E0; --back-card-bg: #FFFFFF; --card-dark-bg: #ECEFF1;
    --text-light: #000000; --text-dim: #222222; --text-dark: #FFFFFF;
    --border1: #FF6FB5; --border2: #4FC3F7; --border3: #81C784; --border4: #FFB74D;
    --border5: #B39DDB; --border6: #64B5F6; --border7: #FFD54F; --border8: #A5D6A7;
}
body.theme-neon {
    --bg: #0b0f1a; --chip1: #00E5FF; --chip2: #FFEA00;
    --header-bg: #111a2b; --back-card-bg: #1c2536; --card-dark-bg: #1f2937;
    --text-light: #000000; --text-dim: #E0E0E0; --text-dark: #FFFFFF;
    --border1: #00E5FF; --border2: #FFEA00; --border3: #69F0AE; --border4: #FF4081;
    --border5: #7C4DFF; --border6: #18FFFF; --border7: #FFC400; --border8: #B9F6CA;
}
body.theme-pastel {
    --bg: #F8F9FB; --chip1: #AED9E0; --chip2: #FFC9DE;
    --header-bg: #EEF2F7; --back-card-bg: #FFFFFF; --card-dark-bg: #ECEFF1;
    --text-light: #000000; --text-dim: #333333; --text-dark: #FFFFFF;
    --border1: #AED9E0; --border2: #FFC9DE; --border3: #C7CEEA; --border4: #B5EAD7;
    --border5: #FFDAC1; --border6: #E2F0CB; --border7: #FFB7B2; --border8: #C7CEEA;
}
body { background-color: var(--bg); color: var(--text-dim); }

body.dark-mode.theme-kids { --bg: #212121; --header-bg: #323232; --text-dim: #E0E0E0; }
body.dark-mode.theme-neon { color: var(--text-dim); }
body.dark-mode.theme-pastel { --bg: #1f2937; --header-bg: #2a384a; --text-dim: #E0E0E0; }
body.dark-mode .panel-content { background-color: var(--card-dark-bg); color: var(--text-dim); }
body.dark-mode input { background-color: #333; color: #fff; border-color: #555; }

.panel {
    display: flex; justify-content: center; align-items: center;
    width: 100%; height: 100vh; position: absolute; top: 0; left: 0;
}
.panel-content {
    background-color: var(--back-card-bg); padding: 30px; border-radius: 16px;
    text-align: center; display: flex; flex-direction: column; gap: 20px;
    align-items: center; max-width: 600px; box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.name-inputs { display: flex; gap: 20px; justify-content: center; }
input[type="text"] { padding: 10px; border-radius: 8px; border: 1px solid #ccc; width: 260px; }

.btn-filled, .btn-outlined, .btn-text {
    padding: 10px 20px; border-radius: 8px; border: none; font-weight: bold;
    cursor: pointer; transition: all 0.2s ease;
}
.btn-filled { background-color: var(--chip1); color: var(--text-light); }
.btn-filled.large { padding: 15px 30px; font-size: 1.1em; }
.btn-outlined { background-color: transparent; border: 1px solid var(--chip1); color: var(--chip1); }
.btn-text { background-color: transparent; color: var(--chip1); }
button:hover { opacity: 0.85; }

#game-screen {
    width: 100%; max-width: 1200px;
    display: flex; flex-direction: column; gap: 15px; height: 100vh; padding: 10px;
}
#header {
    background-color: var(--header-bg); padding: 12px; border-radius: 16px;
    display: flex; justify-content: space-between; align-items: flex-start;
}
.game-status { display: flex; gap: 10px; }
.chip { padding: 8px 16px; border-radius: 20px; font-weight: bold; }
#chip-turn { background-color: var(--chip1); color: var(--text-light); }
#chip-score { background-color: var(--chip2); color: var(--text-light); }
.theme-controls { display: flex; align-items: center; gap: 15px; margin-top: 10px; }
#time-txt { font-weight: bold; font-size: 14px; }
#rules, #subtitle { color: var(--text-dim); }

.switch-container { display: flex; align-items: center; gap: 5px; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--chip1); }
input:checked + .slider:before { transform: translateX(20px); }

#game-area {
    display: flex;
    gap: 20px;
    flex-grow: 1;
    min-height: 0;
}

#board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    flex: 2;
    align-content: start;
}
.card-container {
    perspective: 1000px;
    cursor: pointer;
    height: 140px;
}
.card-inner {
    position: relative; width: 100%; height: 100%;
    transition: transform 0.6s; transform-style: preserve-3d; border-radius: 16px;
}
.card-container.is-flipped .card-inner { transform: rotateY(180deg); }
.card-face {
    position: absolute; width: 100%; height: 100%; backface-visibility: hidden;
    display: flex; justify-content: center; align-items: center;
    border-radius: 16px; padding: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.back-face { 
    background-color: var(--back-card-bg); 
    font-size: 26px; font-weight: bold; color: var(--text-dim);
    border: 3px solid var(--chip1);
}
.front-face {
    background-color: var(--back-card-bg); transform: rotateY(180deg);
    border-width: 3px; border-style: solid; flex-direction: column;
    text-align: center; gap: 5px;
    overflow: hidden;
}
.front-face .header { font-weight: bold; color: var(--text-dim); font-size: 14px; }
.front-face .body { font-size: 12px; color: var(--text-dim); line-height: 1.3; }

#whiteboard-container {
    flex: 1;
    background-color: var(--header-bg);
    border-radius: 16px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#whiteboard-container h2 { font-size: 1em; text-align: center; }
#whiteboard-tools { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.tool-btn {
    padding: 5px 10px; border: 2px solid transparent; border-radius: 5px; cursor: pointer;
    font-size: 0.8em;
}
.tool-btn[data-action="color"] { width: 25px; height: 25px; border-radius: 50%; }
.tool-btn.active { border-color: var(--chip1); box-shadow: 0 0 5px var(--chip1); }
#whiteboard-canvas {
    background-color: #ffffff;
    border-radius: 8px;
    width: 100%;
    flex-grow: 1;
    cursor: crosshair;
    touch-action: none;
}

body.dark-mode .back-face, 
body.dark-mode .front-face { background-color: var(--card-dark-bg); }
body.dark-mode #whiteboard-container { background-color: var(--card-dark-bg); }
body.dark-mode .front-face .body,
body.dark-mode .front-face .header,
body.dark-mode .back-face { color: var(--text-dim); }

#dialog-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5); display: flex;
    justify-content: center; align-items: center; z-index: 1000;
}
#dialog-box {
    background-color: var(--back-card-bg); padding: 20px;
    border-radius: 12px; min-width: 300px; max-width: 500px; text-align: center;
}
body.dark-mode #dialog-box { background-color: var(--card-dark-bg); }
#dialog-content { margin: 15px 0; }
.dialog-actions { display: flex; justify-content: center; gap: 10px; }

#tools {
    display: flex;
    gap: 10px;
    justify-content: center;
}


/* === Hero title styles (Mente Financeira) === */
.hero-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    text-align: center;
}
.hero-title .eyebrow {
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .8;
}
.hero-title .brand {
    font-size: clamp(26px, 6vw, 40px);
    line-height: 1.05;
    font-weight: 800;
    background: linear-gradient(90deg, var(--chip1), var(--chip2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.10));
}
.hero-title .tagline {
    font-size: clamp(14px, 3.8vw, 18px);
    font-weight: 700;
    color: var(--text-dim);
}
.hero-title .pitch {
    font-size: clamp(12px, 3.2vw, 14px);
    max-width: 40ch;
    opacity: .9;
}
@media (max-width: 480px) {
    .hero-title { margin-bottom: 10px; }
}
body.dark-mode .hero-title .brand {
    filter: drop-shadow(0 3px 8px rgba(0,0,0,.35));
}



/* === Mobile-first enhancements (Jenny 2025-10-18 v2) === */
button, .btn, .btn-filled, .btn-outlined, .tool-btn, [role="button"] {
  min-height: 44px;
  min-width: 44px;
}
input[type="text"], input[type="number"], input[type="email"], input[type="search"], select, textarea {
  font-size: 16px;
  padding: 12px 14px;
}
@media (max-width: 768px) {
  header, #header, .app-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .theme-controls, .controls-row, #tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  #tools > * {
    flex: 1 1 48%;
  }
}
@media (max-width: 900px) {
  #game-area, .game-area {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  #whiteboard-container, .whiteboard-container {
    order: 2;
    min-height: 220px;
  }
}
@media (max-width: 1024px) {
  #board, .board-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  .card-container, .card {
    height: 160px;
  }
}
@media (max-width: 768px) {
  #board, .board-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .card-container, .card {
    height: 180px;
  }
  .front-face .header { font-size: 13px; }
  .front-face .body   { font-size: 13px; line-height: 1.35; }
  .back-face { font-size: 28px; }
}
@media (max-width: 400px) {
  #board, .board-grid { gap: 10px; }
  .card-container, .card { height: 190px; }
  .front-face .header { font-size: 12px; }
  .front-face .body   { font-size: 12px; }
}
@media (max-width: 768px) {
  .panel-content, .start-panel-content {
    width: 92%;
    max-width: 420px;
    padding: 20px;
    gap: 16px;
    margin: 0 auto;
  }
  .name-inputs, .inputs-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }
}
@media (max-width: 480px) {
  #dialog-box, .dialog, .modal {
    width: 90%;
    max-width: none;
    padding: 16px;
  }
  #dialog-content { font-size: 14px; }
}
canvas, #whiteboard-canvas { touch-action: none; }
html, body {
  min-height: 100%;
  height: 100%;
  -webkit-text-size-adjust: 100%;
}
