/* ============================================================
   KIDS PIANO (ENGLISH PIANO) — KIDSGURU GAME STYLES
   Dark Navy · Ultra-Glossy 3D Arcade Buttons · Modern Typography
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700;800&family=Poppins:wght@500;600;700;800&display=swap');

:root {
  --font: 'Fredoka', 'Poppins', -apple-system, sans-serif;
  --font-heading: 'Fredoka', sans-serif;
  --navy:  #1e1b4b;
  --navy2: #12103a;
  --purple: #5b21b6;
  --header-h: 60px;
  --tab-h: 74px;
}

*, *::before, *::after {
  box-sizing: border-box; margin: 0; padding: 0;
  user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

html, body {
  width: 100%; height: 100%; overflow: hidden;
  font-family: var(--font);
  background: var(--navy2);
  display: flex; flex-direction: column;
}

/* ═══════════════════════════════════════════════════════════
   TOP HEADER — 3D Dark Navy Arcade Bar
   ═══════════════════════════════════════════════════════════ */
.game-app-header {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  background: linear-gradient(180deg, #2a287a 0%, #1c195a 100%);
  border-bottom: 2.5px solid rgba(255,255,255,0.12);
  box-shadow: 0 6px 24px rgba(0,0,0,0.6);
  flex-shrink: 0; z-index: 50;
}

/* 3D GLOSSY BLUE BACK BUTTON (Matching Time Learning Clock) */
.app-back-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 8px 22px !important;
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 50%, #0369a1 100%) !important;
  color: #ffffff !important;
  border-radius: 50px !important;
  border: 3px solid #7dd3fc !important;
  box-shadow:
    inset 0 2.5px 3px rgba(255, 255, 255, 0.9),
    inset 0 -4px 0 rgba(3, 105, 161, 0.8),
    0 6px 16px rgba(2, 132, 199, 0.45) !important;
  font-family: var(--font-heading) !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  letter-spacing: 0.6px !important;
  text-transform: uppercase !important;
  text-shadow: 0 1.5px 3px rgba(0, 0, 0, 0.5) !important;
  cursor: pointer !important;
  min-height: 44px !important;
  position: relative !important;
  overflow: hidden !important;
  transition: transform 0.1s ease, box-shadow 0.1s ease !important;
}

.app-back-btn::after {
  content: '' !important;
  position: absolute !important; top: 2px !important;
  left: 8px !important; right: 8px !important; height: 38% !important;
  background: linear-gradient(180deg, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.08) 100%) !important;
  border-radius: 50px !important; pointer-events: none !important;
}

.app-back-btn:active {
  transform: translateY(3px) !important;
  box-shadow:
    inset 0 1px 2px rgba(255,255,255,0.6),
    inset 0 -2px 0 rgba(3, 105, 161, 0.8),
    0 2px 8px rgba(2, 132, 199, 0.3) !important;
}

/* Game Title */
.game-app-title {
  font-family: var(--font-heading);
  font-size: 21px; font-weight: 800; color: #ffffff;
  letter-spacing: 0.6px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.6);
  display: flex; align-items: center; gap: 9px;
}

/* ═══════════════════════════════════════════════════════════
   CANVAS CONTAINER
   ═══════════════════════════════════════════════════════════ */
.canvas-container {
  flex: 1;
  width: 100%;
  height: calc(100dvh - var(--header-h) - var(--tab-h));
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: var(--navy);
}

#gameCanvas {
  display: block; width: 100%; height: 100%;
  cursor: pointer; touch-action: none;
}

/* ═══════════════════════════════════════════════════════════
   BOTTOM TAB BAR (3D Modes matching Time Learning Clock)
   ═══════════════════════════════════════════════════════════ */
.mode-tab-bar {
  height: var(--tab-h);
  background: linear-gradient(180deg, #2a287a 0%, #1c195a 100%);
  border-top: 2.5px solid rgba(255,255,255,0.12);
  box-shadow: 0 -6px 24px rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  padding: 6px 12px 8px;
  gap: 8px;
  flex-shrink: 0;
  z-index: 50;
}

/* Round Yellow Speaker Mute Button */
.mute-circle-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  background: linear-gradient(180deg, #ffe237 0%, #f5c700 50%, #c99500 100%);
  border: 3px solid #fff59d;
  box-shadow:
    inset 0 2.5px 3px rgba(255, 255, 255, 0.9),
    inset 0 -4px 0 rgba(120, 80, 0, 0.75),
    0 5px 16px rgba(200, 160, 0, 0.5);
  position: relative; overflow: hidden;
  transition: transform 0.1s ease;
  font-size: 22px;
}

.mute-circle-btn::after {
  content: ''; position: absolute; top: 3px; left: 5px; right: 5px; height: 38%;
  background: linear-gradient(180deg, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.06) 100%);
  border-radius: 50%; pointer-events: none;
}

.mute-circle-btn:active { transform: translateY(3px); }

/* Mode Tab Buttons */
.mode-tab {
  flex: 1;
  height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  border-radius: 16px;
  border: none;
  background: rgba(255,255,255,0.08);
  cursor: pointer;
  position: relative; overflow: hidden;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
  padding: 5px 4px 6px;
}

.mode-tab::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.12);
  pointer-events: none;
}

.mode-tab::after {
  content: '';
  position: absolute; top: 2px; left: 8px; right: 8px; height: 34%;
  background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.01) 100%);
  border-radius: 10px; pointer-events: none;
}

.mode-tab:active { transform: scale(0.94); }

/* Active Tab — Glossy 3D Purple/Yellow Glow */
.mode-tab.active {
  background: linear-gradient(180deg, #a855f7 0%, #7c3aed 50%, #5b21b6 100%);
  border: 2.5px solid #e9d5ff;
  box-shadow:
    inset 0 2.5px 3px rgba(255,255,255,0.9),
    inset 0 -3.5px 0 rgba(60, 10, 120, 0.75),
    0 6px 18px rgba(124, 58, 237, 0.55);
  transform: translateY(-2px);
}

.mode-tab.active::before { border-color: rgba(233, 213, 255, 0.4); }
.mode-tab.active .mode-tab__label { color: #ffffff; text-shadow: 0 1.5px 3px rgba(0,0,0,0.6); }

.mode-tab__emoji {
  font-size: 22px; line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.mode-tab__label {
  font-family: var(--font-heading);
  font-size: 12px; font-weight: 800;
  color: rgba(255,255,255,0.78);
  letter-spacing: 0.3px; line-height: 1;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  white-space: nowrap;
}

@media (max-width: 400px) {
  .mode-tab__emoji { font-size: 19px; }
  .mode-tab__label { font-size: 10px; }
  .mute-circle-btn { width: 46px; height: 46px; font-size: 18px; }
  :root { --tab-h: 66px; --header-h: 54px; }
  .game-app-title { font-size: 18px; }
  .app-back-btn { font-size: 13px !important; padding: 6px 16px !important; min-height: 38px !important; }
}
