/* ===========================================================================
   Campus Blocks — stylesheet (light glassmorphism, Stitch design)
   Supplements Tailwind with component styles Tailwind can't easily express:
   screens, glass cards, loader animation, leaderboard tabs/rows, canvas overlay,
   modal, toast.
   =========================================================================== */

:root {
  /* Official campus colors */
  --c-blue: #005A9C;
  --c-red: #C41230;
  --c-green: #00847F;
  --gold: #fbbf24;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
}

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ---------------- glass cards / panels ---------------- */
.glass-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* gradient accent orbs */
.gradient-accent {
  filter: blur(80px);
  opacity: 0.4;
  z-index: 0;
  pointer-events: none;
}

/* input underline animation */
input:focus {
  outline: none;
}

.input-underline::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--c-blue);
  transition: width 0.3s ease;
}

input:focus+.input-underline::after {
  width: 100%;
}

/* ---------------- screens ---------------- */
.screen {
  position: fixed;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  overflow-y: auto;
  z-index: 1;
}

.screen.active {
  opacity: 1;
  visibility: visible;
}

/* ---------------- school selection buttons ---------------- */
.school-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  border: 2px solid transparent;
  border-radius: 0.75rem;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.school-card:hover {
  transform: translateY(-2px);
}

.school-card .school-card__letter {
  width: 48px;
  height: 48px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  color: #fff;
  overflow: hidden;
}

.school-card[aria-checked="true"] {
  border-color: var(--school-color);
  background: color-mix(in srgb, var(--school-color) 12%, rgba(255, 255, 255, 0.7));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--school-color) 25%, transparent);
}

.school-card .check-icon {
  opacity: 0;
  color: var(--school-color);
  transition: opacity 0.2s;
}

.school-card[aria-checked="true"] .check-icon {
  opacity: 1;
  font-variation-settings: 'FILL' 1;
}

/* ===================== LOADING SCREEN ===================== */
.loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(900px 500px at 50% 30%, rgba(0, 90, 156, 0.10), transparent 60%), #f8f9ff;
  transition: opacity 0.35s ease;
}

.loader.active {
  display: flex;
}

.loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* Block-drop loader — adapted to the light glassmorphism style */
.blocks-loader {
  position: relative;
  width: 132px;
  height: 66px;
}

.blocks-loader .base-line {
  position: absolute;
  bottom: -6px;
  left: -11px;
  width: 154px;
  height: 3px;
  background: linear-gradient(90deg, var(--c-blue), var(--c-red), var(--c-green));
  border-radius: 2px;
  opacity: 0.5;
}

.blocks-loader .piece {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.blocks-loader .block {
  width: 22px;
  height: 22px;
  position: absolute;
  border-radius: 3px;
  box-sizing: border-box;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), inset 2px 2px 3px rgba(255, 255, 255, 0.5);
}

.blocks-loader .color-blue .block {
  background: var(--c-blue);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), inset 2px 2px 3px rgba(255, 255, 255, 0.5), 0 0 8px rgba(0, 90, 156, 0.4);
}

.blocks-loader .color-red .block {
  background: var(--c-red);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), inset 2px 2px 3px rgba(255, 255, 255, 0.5), 0 0 8px rgba(196, 18, 48, 0.4);
}

.blocks-loader .color-green .block {
  background: var(--c-green);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), inset 2px 2px 3px rgba(255, 255, 255, 0.5), 0 0 8px rgba(0, 132, 127, 0.4);
}

.blocks-loader .piece {
  animation-duration: 3.6s;
  animation-iteration-count: infinite;
  opacity: 0;
}

.blocks-loader .p1 {
  animation-name: drop1;
}

.blocks-loader .p2 {
  animation-name: drop2;
}

.blocks-loader .p3 {
  animation-name: drop3;
}

.blocks-loader .p4 {
  animation-name: drop4;
}

.blocks-loader .p5 {
  animation-name: drop5;
}

.blocks-loader .p6 {
  animation-name: drop6;
}

@keyframes drop1 {
  0% {
    opacity: 0;
    transform: translateY(-34px)
  }

  5% {
    opacity: 1;
    transform: translateY(2px)
  }

  7%,
  82% {
    opacity: 1;
    transform: translateY(0)
  }

  88%,
  100% {
    opacity: 0;
    transform: translateY(0)
  }
}

@keyframes drop2 {

  0%,
  13% {
    opacity: 0;
    transform: translateY(-34px)
  }

  18% {
    opacity: 1;
    transform: translateY(2px)
  }

  20%,
  82% {
    opacity: 1;
    transform: translateY(0)
  }

  88%,
  100% {
    opacity: 0;
    transform: translateY(0)
  }
}

@keyframes drop3 {

  0%,
  26% {
    opacity: 0;
    transform: translateY(-34px)
  }

  31% {
    opacity: 1;
    transform: translateY(2px)
  }

  33%,
  82% {
    opacity: 1;
    transform: translateY(0)
  }

  88%,
  100% {
    opacity: 0;
    transform: translateY(0)
  }
}

@keyframes drop4 {

  0%,
  39% {
    opacity: 0;
    transform: translateY(-34px)
  }

  44% {
    opacity: 1;
    transform: translateY(2px)
  }

  46%,
  82% {
    opacity: 1;
    transform: translateY(0)
  }

  88%,
  100% {
    opacity: 0;
    transform: translateY(0)
  }
}

@keyframes drop5 {

  0%,
  52% {
    opacity: 0;
    transform: translateY(-34px)
  }

  57% {
    opacity: 1;
    transform: translateY(2px)
  }

  59%,
  82% {
    opacity: 1;
    transform: translateY(0)
  }

  88%,
  100% {
    opacity: 0;
    transform: translateY(0)
  }
}

@keyframes drop6 {

  0%,
  65% {
    opacity: 0;
    transform: translateY(-34px)
  }

  70% {
    opacity: 1;
    transform: translateY(2px)
  }

  72%,
  82% {
    opacity: 1;
    transform: translateY(0)
  }

  88%,
  100% {
    opacity: 0;
    transform: translateY(0)
  }
}

.loader__text {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 6px;
  color: #191c20;
  opacity: 0.6;
  animation: pulse 1.1s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 0.4
  }

  50% {
    opacity: 0.9
  }
}

/* ===================== LEADERBOARD ===================== */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tab {
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.5);
  color: #727781;
  font-family: 'Geist', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all 0.2s;
}

.tab:hover {
  color: #191c20;
}

.tab[aria-selected="true"] {
  color: #fff;
  background: var(--tab-color, var(--c-blue));
  border-color: var(--tab-color, var(--c-blue));
  box-shadow: 0 2px 8px color-mix(in srgb, var(--tab-color, var(--c-blue)) 35%, transparent);
}

.leaderboard-body {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 8px;
  min-height: 120px;
  max-height: 320px;
  overflow-y: auto;
}

.lb-row {
  display: grid;
  grid-template-columns: 36px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.lb-row+.lb-row {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.lb-row__rank {
  font-family: 'Geist', monospace;
  font-weight: 700;
  color: #727781;
}

.lb-row__rank--top {
  color: var(--gold);
}

.lb-row__name {
  color: #191c20;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-row__school {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  box-shadow: 0 0 4px currentColor;
}

.lb-row__score {
  font-family: 'Geist', monospace;
  font-weight: 700;
  color: #191c20;
}

.lb-empty,
.lb-loading {
  padding: 24px;
  text-align: center;
  color: #727781;
  font-size: 13px;
}

/* ===================== CANVAS + OVERLAY ===================== */
#game {
  display: block;
  border-radius: 8px;
  background: #fbfcfe;
  /* Match the Stitch design: 85vh height, 12:24 (1:2) aspect ratio.
     Internal resolution stays 360x720; CSS only changes the drawn size. */
  height: 85vh;
  max-height: calc(100vh - 120px);
  aspect-ratio: 1 / 2;
  width: auto;
  max-width: 100%;
}

.overlay {
  position: absolute;
  inset: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 249, 255, 0.8);
  border-radius: 8px;
  backdrop-filter: blur(6px);
  z-index: 10;
}

.overlay[hidden] {
  display: none !important;
}

.overlay__box {
  text-align: center;
}

.overlay__box kbd {
  display: inline-block;
  padding: 1px 6px;
  margin: 0 2px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  font-family: 'Geist', monospace;
  font-size: 11px;
}

/* ===================== MODAL ===================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal[aria-hidden="false"] {
  display: flex;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(248, 249, 255, 0.7);
  backdrop-filter: blur(8px);
}

.modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 800px;
  max-height: 92vh;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@keyframes float {
  0% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-10px)
  }

  100% {
    transform: translateY(0)
  }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

/* ===================== TOAST ===================== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid var(--c-red);
  border-radius: 10px;
  color: #191c20;
  padding: 12px 18px;
  font-size: 14px;
  z-index: 300;
  box-shadow: 0 4px 20px rgba(196, 18, 48, 0.2);
  max-width: 90vw;
}

/* ===================== RESPONSIVE ===================== */
/* Game screen: on smaller viewports stack the HUD below the canvas. */
@media (max-width: 1024px) {
  .game main .grid {
    grid-template-columns: 1fr !important;
    justify-items: center;
  }

  .game main .hidden.md\:flex {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    max-width: 600px;
  }

  .game main .glass-panel {
    width: auto !important;
    min-width: 160px;
  }

  .game main .items-end {
    align-items: center !important;
  }

  .game main .items-start {
    align-items: center !important;
  }

  #game {
    height: min(600px, calc(100vh - 200px));
  }
}

@media (max-width: 900px) {
  .game main {
    padding-top: 5rem;
  }

  #game {
    height: min(540px, calc(100vh - 180px));
  }
}

@media (max-width: 768px) {
  .modal__panel {
    padding: 20px;
  }
}

@media (max-width: 640px) {
  #game {
    height: min(460px, calc(100vh - 140px));
  }
}

/* ===================== PAPER THEME ===================== */
body.paper-theme {
  background: url('/images/folded-paper-bg.jpg') no-repeat center center fixed !important;
  background-size: cover !important;
  color: #1a1a1a !important;
}

/* Hide background gradient accents when paper-theme is active */
body.paper-theme .gradient-accent {
  display: none !important;
}

/* Header style for paper-theme */
body.paper-theme #gameHeader {
  background: transparent !important;
  border-bottom: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.paper-theme #exitBtn {
  color: #000000 !important;
  font-family: 'Geist', sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em !important;
  font-size: 14px !important;
}

body.paper-theme #exitBtn .material-symbols-outlined {
  display: none !important;
}

body.paper-theme #headerSeparator {
  background-color: rgba(0, 0, 0, 0.15) !important;
  width: 1px !important;
}

body.paper-theme #playerTag {
  color: #000000 !important;
  font-family: 'Geist', sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em !important;
  font-size: 14px !important;
}

/* Paper cards overrides */
body.paper-theme .glass-panel,
body.paper-theme .glass-card {
  background: #ffffff !important;
  border-radius: 16px !important;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02) !important;
  color: #1a1a1a !important;
}

/* Board container recessed styling */
body.paper-theme .game main .group .glass-panel {
  background: #ffffff !important;
  border-radius: 20px !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05), 0 10px 40px rgba(0, 0, 0, 0.03) !important;
  padding: 12px !important;
}

body.paper-theme #game {
  background: #ffffff !important;
  border-radius: 12px !important;
  border: 1px solid rgba(0, 0, 0, 0.03) !important;
}

/* Card stack logic */
body.paper-theme .paper-stack {
  position: relative;
  z-index: 5;
}

body.paper-theme .paper-stack::before,
body.paper-theme .paper-stack::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
  pointer-events: none;
  transition: transform 0.3s ease;
}

/* Left controls card stack offsets */
body.paper-theme #controlsStack::before {
  transform: translate(-3px, 3px) rotate(-0.8deg) !important;
  z-index: -1 !important;
}

body.paper-theme #controlsStack::after {
  transform: translate(3px, 6px) rotate(1.2deg) !important;
  z-index: -2 !important;
}

/* Right HUD card stack offsets */
body.paper-theme #hudStack::before {
  transform: translate(-3px, 3px) rotate(-0.6deg) !important;
  z-index: -1 !important;
}

body.paper-theme #hudStack::after {
  transform: translate(3px, 5px) rotate(0.8deg) !important;
  z-index: -2 !important;
}

/* ===================== NEW RESPONSIVE MOCKUP LAYOUT ===================== */

.game-outer-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- DESKTOP LAYOUT (1024px and up) --- */
@media (min-width: 1024px) {
  .game {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100vw;
    background: url('/images/folded-paper-bg.jpg') no-repeat center center fixed !important;
    background-size: cover !important;
    overflow: hidden !important;
    padding: 0 !important;
  }

  .game-outer-container {
    margin-top: 0;
    height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .game-wrapper {
    width: 100%;
    max-width: calc(100vh * (5504 / 2922));
    max-height: 100vh;
    aspect-ratio: 5504 / 2922;
    background: url('/images/game_bg_main.jpg?v=7') no-repeat center center;
    background-size: cover;
    position: relative;
    overflow: hidden;
    container-type: size;
    /* Enable container query units! */
  }

  /* Exit Button & Player Tag */
  .hud-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 5rem;
    background: transparent;
    border-bottom: none;
    display: flex;
    align-items: center;
    padding-left: 2.2rem;
    gap: 0.8rem;
    pointer-events: none;
    z-index: 50;
  }

  #exitBtn {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: 0.15em;
    font-size: 2.2rem;
    color: #191c20;
    background: transparent;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    transition: opacity 0.2s;
    outline: none;
    pointer-events: auto;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
  }

  #exitBtn:hover {
    opacity: 0.7;
  }

  .hud-separator {
    font-family: 'Outfit', sans-serif;
    font-weight: 400;
    font-size: 2.2rem;
    color: rgba(25, 28, 32, 0.2);
    margin: 0 0.3rem;
    user-select: none;
    display: inline-flex;
  }

  #playerTag {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: 0.15em;
    font-size: 2.2rem;
    color: #191c20;
    text-transform: uppercase;
    pointer-events: auto;
  }

  /* Board Container (Canvas) */
  .board-container {
    position: absolute;
    left: 38.154%;
    top: 7.1868%;
    width: 23.9825%;
    height: 90.349%;
    border-radius: 0;
    box-shadow: none;
    border: none;
    background: transparent;
  }

  #game {
    width: 100%;
    height: 100%;
    border-radius: 0;
    background: #ffffff;
    max-height: none !important;
    aspect-ratio: auto !important;
  }

  /* School Badge Overlay */
  .school-badge-overlay {
    position: absolute;
    left: 21.439%;
    top: 66.5%;
    width: 9.084%;
    height: 5.475%;
    display: flex;
    align-items: center;
    gap: 0.8cqw;
    background: transparent;
    border: none;
  }

  .school-logo-frame {
    width: 2.3cqw;
    height: 2.3cqw;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
  }

  .school-badge__logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .school-badge__name {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.2cqw;
    color: #191c20;
    letter-spacing: -0.02em;
    line-height: 1.05;
  }

  .school-badge-overlay[data-school-id="bktm"] .school-badge__name {
    font-size: 1.3cqw;
  }

  .school-badge-overlay[data-school-id="mercator"] .school-badge__name {
    font-size: 1.1cqw;
  }

  .school-badge-overlay[data-school-id="hermann_gmeiner"] .school-badge__name {
    font-size: 0.9cqw;
  }

  .school-badge-overlay[data-school-id="pflege_gesundheit"] .school-badge__name {
    font-size: 0.75cqw;
  }

  /* Last Action Combo Overlay */
  .last-action-overlay {
    position: absolute;
    left: 21.439%;
    top: 81.5%;
    width: 9.084%;
    height: 6.16%;
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
  }

  #comboText {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 2.5cqw;
    color: #191c20;
    letter-spacing: -0.04em;
  }

  /* Stats Overlay */
  .stat-box {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: transparent;
    border: none;
    pointer-events: none;
  }

  .score-box {
    position: absolute;
    left: 66.0%;
    top: 41.3%;
    width: 12.6%;
    height: 5.0%;
  }

  .level-box {
    position: absolute;
    left: 66.0%;
    top: 51.0%;
    width: 12.6%;
    height: 4.8%;
  }

  .lines-box {
    position: absolute;
    left: 66.0%;
    top: 60.9%;
    width: 12.6%;
    height: 5.5%;
  }

  .stat-value {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 3.25cqw;
    color: #191c20 !important;
    line-height: 1;
    letter-spacing: -0.05em;
  }
}

/* --- MOBILE LAYOUT (Under 1024px) --- */
@media (max-width: 1023px) {
  .game {
    background: url('/images/folded-paper-bg.jpg') no-repeat center center fixed !important;
    background-size: cover !important;
    min-height: 100vh;
    padding-top: 1rem;
    padding-bottom: 2rem;
    overflow-y: auto !important;
  }

  .game-outer-container {
    width: 100%;
    padding: 1rem;
  }

  .game-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    align-items: center;
  }

  /* Top Bar */
  .hud-top-bar {
    width: 100%;
    max-width: 500px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    order: 1;
  }

  .hud-separator {
    display: none;
  }

  #exitBtn {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    color: #191c20;
    background: transparent;
    border: none;
    cursor: pointer;
  }

  #playerTag {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    color: #64748b;
  }

  /* Center Panel / Canvas */
  .board-container {
    order: 2;
    position: relative;
    width: auto;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  }

  #game {
    display: block;
    border-radius: 6px;
    background: #ffffff;
    height: min(480px, calc(100vh - 240px));
    aspect-ratio: 1 / 2;
    width: auto;
    max-width: 100%;
  }

  /* Stats Boxes Layout on Mobile (flex container row below the board) */
  .stat-box {
    width: 100%;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  }

  .score-box {
    order: 3;
  }

  .level-box {
    order: 4;
  }

  .lines-box {
    order: 5;
  }

  .mobile-label {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .stat-value {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    color: #191c20 !important;
  }

  /* School Badge and Last Action Cards */
  .school-badge-overlay {
    order: 6;
    width: 100%;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  }

  .school-logo-frame {
    width: 24px;
    height: 24px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
  }

  .school-badge__logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .school-badge__name {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: #191c20;
    line-height: 1.1;
  }

  .school-badge-overlay[data-school-id="bktm"] .school-badge__name {
    font-size: 1.1rem;
  }

  .school-badge-overlay[data-school-id="mercator"] .school-badge__name {
    font-size: 0.95rem;
  }

  .school-badge-overlay[data-school-id="hermann_gmeiner"] .school-badge__name {
    font-size: 0.9rem;
  }

  .school-badge-overlay[data-school-id="pflege_gesundheit"] .school-badge__name {
    font-size: 0.8rem;
  }

  .last-action-overlay {
    order: 7;
    width: 100%;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  }

  #comboText {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 1.25rem;
    color: #191c20;
  }

  /* Controls card on mobile */
  .controls-card-overlay {
    order: 8;
    width: 100%;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  }
}