/* Τανγκραμάκια · Tangram Quest Stylesheet */

@font-face {
  font-family: 'Ubuntu Sans';
  font-style: normal;
  font-weight: 400 800;
  src: url('assets/fonts/ubuntu-sans-greek-wght-normal.woff2') format('woff2');
  unicode-range: U+0370-03FF, U+1F00-1FFF;
}

@font-face {
  font-family: 'Ubuntu Sans';
  font-style: normal;
  font-weight: 400 800;
  src: url('assets/fonts/ubuntu-sans-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC;
}

:root {
  --bg-dark: #0F172A;
  --bg-card: #1E293B;
  --bg-gradient: radial-gradient(circle at 50% 30%, #312E81 0%, #1E1B4B 60%, #0F172A 100%);
  --accent-amber: #F59E0B;
  --accent-coral: #F43F5E;
  --accent-cyan: #0EA5E9;
  --accent-purple: #8B5CF6;
  --text-primary: #F8FAFC;
  --text-muted: #94A3B8;
  --radius-lg: 20px;
  --radius-md: 12px;
  --font-family: 'Ubuntu Sans', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-dark);
  font-family: var(--font-family);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
}

/* SpeedGuard Red Warning Banner */
.gt-speedguard-banner {
  display: none;
  background: #DC2626;
  color: #FFFFFF;
  padding: 10px 16px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  z-index: 99999;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.5);
  animation: pulseWarning 1.5s infinite;
}

@keyframes pulseWarning {
  0%, 100% { background: #DC2626; }
  50% { background: #991B1B; }
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: relative;
  background: var(--bg-gradient);
}

.hidden {
  display: none !important;
}

/* Top Nav Bars */
.top-nav, .game-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 10;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  height: 28px;
}

.suite-tag {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.15);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.screen-title {
  font-size: 20px;
  font-weight: 800;
  color: #FFFFFF;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pill-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.pill-btn.hint-btn.active {
  background: #F59E0B;
  color: #0F172A;
  border-color: #FBBF24;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.6);
}

/* Home Screen */
.home-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.hero-card {
  max-width: 580px;
  width: 100%;
  background: rgba(30, 41, 59, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  text-align: center;
  backdrop-filter: blur(12px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.mascot-container {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.mascot-img {
  width: 130px;
  height: 130px;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.4));
}

.pulse-anim {
  animation: floatMascot 3s ease-in-out infinite;
}

@keyframes floatMascot {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.game-title {
  font-size: 38px;
  font-weight: 900;
  background: linear-gradient(135deg, #FFFFFF 0%, #FED7AA 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.game-subtitle {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 12px;
}

.game-tagline {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 28px;
}

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.btn {
  font-family: inherit;
  font-size: 17px;
  font-weight: 800;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, #F59E0B 0%, #EA580C 100%);
  color: #FFFFFF;
  box-shadow: 0 10px 20px -5px rgba(234, 88, 12, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 25px -5px rgba(234, 88, 12, 0.55);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent-amber);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.link-btn:hover {
  color: #FBBF24;
}

/* Map Screen */
.map-intro {
  text-align: center;
  padding: 14px 20px 6px;
  color: var(--text-muted);
  font-size: 15px;
}

.map-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 40px;
  display: flex;
  justify-content: center;
}

.lessons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
  max-width: 960px;
  width: 100%;
}

.lesson-card {
  background: rgba(30, 41, 59, 0.65);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lesson-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-amber);
  background: rgba(30, 41, 59, 0.9);
  box-shadow: 0 14px 25px -8px rgba(0, 0, 0, 0.5);
}

.lesson-card.sandbox-card {
  border-color: rgba(139, 92, 246, 0.4);
}

.lesson-card.sandbox-card:hover {
  border-color: var(--accent-purple);
}

.card-icon {
  font-size: 42px;
  margin-bottom: 10px;
}

.card-title {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 6px;
  color: #FFFFFF;
}

.card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 12px;
  flex: 1;
}

.card-stars {
  display: flex;
  gap: 4px;
}

.star-icon {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.2);
}

.star-icon.earned {
  color: #FACC15;
  text-shadow: 0 0 8px rgba(250, 204, 21, 0.7);
}

/* Game Screen */
.game-nav-left, .game-nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.level-title-badge {
  font-size: 16px;
  font-weight: 800;
  color: #F8FAFC;
  background: rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.canvas-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  position: relative;
  overflow: hidden;
}

#gameCanvas {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  width: auto;
  height: auto;
  aspect-ratio: 800 / 560;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.controls-hint {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.6);
  padding: 4px 12px;
  border-radius: 999px;
}

/* Diploma Screen */
.diploma-main {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.diploma-input-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  background: rgba(30, 41, 59, 0.7);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.diploma-input-bar label {
  font-size: 14px;
  font-weight: 700;
}

.diploma-input-bar input {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  outline: none;
}

.diploma-input-bar input:focus {
  border-color: var(--accent-amber);
}

.diploma-sheet {
  width: 720px;
  max-width: 100%;
  aspect-ratio: 1.414 / 1;
  background: #FFFBEB;
  color: #1E293B;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  position: relative;
}

.diploma-border {
  border: 4px double #D97706;
  border-radius: 8px;
  height: 100%;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.diploma-header {
  text-align: center;
}

.diploma-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #B45309;
  background: #FEF3C7;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid #FCD34D;
  margin-bottom: 12px;
}

.diploma-title {
  font-size: 28px;
  font-weight: 900;
  color: #92400E;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.diploma-subtitle {
  font-size: 14px;
  color: #475569;
}

.diploma-recipient {
  text-align: center;
  margin: 18px 0;
}

.child-name-display {
  font-size: 32px;
  font-weight: 900;
  color: #1E293B;
  margin-bottom: 4px;
}

.underline-line {
  width: 240px;
  height: 3px;
  background: #D97706;
  margin: 0 auto;
  border-radius: 2px;
}

.diploma-stars-row {
  text-align: center;
  margin-bottom: 12px;
}

.stars-val {
  display: block;
  font-size: 26px;
  font-weight: 900;
  color: #D97706;
}

.stars-label {
  font-size: 12px;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.diploma-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.seal-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.seal-icon {
  width: 50px;
  height: 50px;
}

.seal-text {
  font-size: 12px;
  font-weight: 800;
  color: #B45309;
}

.date-box {
  text-align: right;
  font-size: 13px;
}

.date-label {
  color: #64748B;
}

.date-val {
  font-weight: 700;
  color: #1E293B;
}

/* Victory Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-card {
  background: var(--bg-card);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  animation: popIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-mascot {
  margin-bottom: 12px;
}

.modal-title {
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 6px;
}

.modal-desc {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.modal-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.star-large {
  font-size: 38px;
  color: rgba(255, 255, 255, 0.2);
}

.star-large.earned {
  color: #FACC15;
  text-shadow: 0 0 16px rgba(250, 204, 21, 0.8);
  animation: starPulse 0.5s ease-out;
}

@keyframes starPulse {
  0% { transform: scale(0.5); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Print Styles */
@media print {
  body {
    background: #FFFFFF !important;
  }
  .no-print, .top-nav, .gt-speedguard-banner {
    display: none !important;
  }
  .screen:not(#diplomaScreen) {
    display: none !important;
  }
  #diplomaScreen {
    background: none !important;
  }
  .diploma-sheet {
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
    padding: 0 !important;
  }
}
