:root {
  --bg: #f7fbff;
  --paper: #ffffff;
  --paper-soft: #fff8fb;
  --ink: #25324a;
  --muted: #6d7b91;
  --line: #dce8f5;
  --sky: #74c7ee;
  --sky-deep: #2f8dc7;
  --sakura: #ff9fbd;
  --sun: #ffd66b;
  --leaf: #7fc7a5;
  --shadow: 0 16px 40px rgba(64, 105, 144, 0.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    linear-gradient(180deg, #eef8ff 0%, #fffafd 42%, #f7fbff 100%);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
  line-height: 1.65;
}
button, input, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }

[data-shell] {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(116, 199, 238, 0.32);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 28px rgba(73, 128, 171, 0.08);
}
.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-weight: 900;
}
.brand-mark {
  width: 24px;
  height: 24px;
  border: 3px solid var(--sky);
  border-radius: 50%;
  background: linear-gradient(135deg, #fff, #e8f7ff 55%, #ffd9e6);
  box-shadow: inset -3px -3px 0 rgba(255, 159, 189, 0.35);
}
.nav {
  display: flex;
  justify-content: center;
  gap: clamp(10px, 2vw, 22px);
}
.nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}
.nav a:hover { color: var(--sky-deep); }
.account {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-badge {
  max-width: 180px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button, .ghost, .primary, .secondary, .tabs button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.icon-button {
  width: 42px;
  background: var(--paper);
  color: var(--sky-deep);
  font-size: 18px;
  box-shadow: var(--shadow);
}
.ghost, .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  color: var(--sky-deep);
  padding: 9px 14px;
}
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: transparent;
  background: linear-gradient(135deg, var(--sky), #9ee6ff 55%, #ffe1ec);
  color: #183047;
  font-weight: 900;
  padding: 10px 18px;
  box-shadow: 0 10px 24px rgba(47, 141, 199, 0.2);
}
.hidden { display: none !important; }

.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  padding: 112px clamp(18px, 7vw, 96px) 84px;
  overflow: hidden;
}
.hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(247, 251, 255, 0.96) 0%, rgba(247, 251, 255, 0.74) 48%, rgba(255, 248, 251, 0.28) 100%),
    radial-gradient(circle at 76% 28%, rgba(255, 159, 189, 0.36), transparent 28%),
    radial-gradient(circle at 22% 76%, rgba(116, 199, 238, 0.24), transparent 24%);
}
.hero-media {
  position: absolute;
  inset: 0;
  background-image: url("https://images.unsplash.com/photo-1540959733332-eab4deabeeaf?auto=format&fit=crop&w=1800&q=82");
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
}
.kicker {
  margin: 0 0 10px;
  color: var(--sky-deep);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}
h1 {
  margin: 0 0 14px;
  color: #1e3148;
  font-size: clamp(44px, 8vw, 92px);
  line-height: 0.98;
}
.hero-copy, .page-hero p {
  max-width: 720px;
  color: #445773;
  font-size: clamp(18px, 2.3vw, 24px);
  font-weight: 700;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.japan-band {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 24px;
  align-items: stretch;
  padding: 58px clamp(16px, 5vw, 72px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.94), rgba(255, 248, 251, 0.76)),
    url("https://images.unsplash.com/photo-1524413840807-0c3cb6fa808d?auto=format&fit=crop&w=1600&q=82");
  background-size: cover;
  background-position: center;
}
.japan-band h2, .section-title h2 {
  margin: 0 0 10px;
  color: #213852;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.05;
}
.japan-band p {
  max-width: 620px;
  color: #52647d;
  font-weight: 700;
}
.japan-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.japan-cards article {
  min-height: 160px;
  display: grid;
  align-content: end;
  border: 1px solid rgba(255, 159, 189, 0.36);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow);
  padding: 16px;
}
.japan-cards span {
  color: var(--sakura);
  font-size: 28px;
  font-weight: 900;
}
.japan-cards strong {
  color: var(--ink);
  font-weight: 800;
}

.entry-test {
  padding: 58px clamp(16px, 5vw, 72px);
  background: linear-gradient(180deg, #f8fcff, #fff7fb);
  border-bottom: 1px solid var(--line);
}
.section-title {
  max-width: 1100px;
  margin: 0 auto 22px;
}
.section-title p:last-child { color: var(--muted); }
.quiz-form {
  max-width: 1100px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  padding: 16px;
}
.quiz-form label {
  display: grid;
  gap: 8px;
  color: #4f6178;
  font-weight: 800;
}
.quiz-form button, .quiz-form .form-message { grid-column: 1 / -1; }
.quiz-results {
  max-width: 1100px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 16px auto 0;
}
.quiz-results article {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: 12px;
}
.quiz-results .correct { border-color: rgba(127, 199, 165, 0.72); }
.quiz-results .wrong { border-color: rgba(255, 159, 189, 0.78); }
.quiz-results span, .quiz-results small { color: var(--muted); }

.portal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 28px clamp(16px, 5vw, 72px) 72px;
  background: #eef8ff;
}
.portal-grid a {
  min-height: 132px;
  display: grid;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: 18px;
}
.portal-grid a:hover { transform: translateY(-2px); }
.portal-grid span {
  color: var(--sky-deep);
  font-weight: 900;
  font-size: 22px;
}
.portal-grid strong {
  color: var(--muted);
  font-weight: 700;
}

.page { padding-top: 68px; }
.page-hero {
  min-height: 360px;
  display: grid;
  align-content: end;
  padding: 78px clamp(16px, 5vw, 72px) 46px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.95), rgba(238, 248, 255, 0.7)),
    var(--hero-image);
  background-size: cover;
  background-position: center;
}
.image-hero { --hero-image: url("https://images.unsplash.com/photo-1493976040374-85c8e12f0c0e?auto=format&fit=crop&w=1600&q=82"); }
.video-hero { --hero-image: url("https://images.unsplash.com/photo-1542051841857-5f90071e7989?auto=format&fit=crop&w=1600&q=82"); }
.forum-hero { --hero-image: url("https://images.unsplash.com/photo-1516321318423-f06f85e504b3?auto=format&fit=crop&w=1600&q=82"); }
.game-hero { --hero-image: url("https://images.unsplash.com/photo-1511512578047-dfb367046420?auto=format&fit=crop&w=1600&q=82"); }
.vr-hero { --hero-image: url("https://images.unsplash.com/photo-1593508512255-86ab42a8e620?auto=format&fit=crop&w=1600&q=82"); }
.math-hero { --hero-image: url("https://images.unsplash.com/photo-1635070041078-e363dbe005cb?auto=format&fit=crop&w=1600&q=82"); }
.cloud-hero { --hero-image: url("https://images.unsplash.com/photo-1451187580459-43490279c0fa?auto=format&fit=crop&w=1600&q=82"); }
.tool-band, .teaching-layout { padding: 34px clamp(16px, 5vw, 72px) 80px; }

.upload-form, .forum-form, .post-card, .empty, .side-panel, .formula-panel, .whiteboard, .file-row, .media-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}
.upload-form {
  max-width: 1100px;
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1fr) auto;
  gap: 12px;
  margin: 0 auto 18px;
  padding: 16px;
}
input, textarea {
  width: 100%;
  border: 1px solid #c9dced;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
  padding: 11px 12px;
}
input:focus, textarea:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 4px rgba(116, 199, 238, 0.2);
}
input[type="file"] { min-height: 44px; }
.form-message {
  min-height: 24px;
  margin: 0;
  color: #d17b22;
  font-weight: 800;
}
.upload-form .form-message { grid-column: 1 / -1; }

.featured-gallery, .media-grid {
  max-width: 1100px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 0 auto;
}
.featured-gallery {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 18px;
}
.featured-gallery article, .media-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.featured-gallery img, .media-card img, .media-card video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #eef8ff;
}
.featured-gallery img, .media-card img[data-lightbox-src] {
  cursor: zoom-in;
}
.featured-gallery div, .media-card div {
  display: grid;
  gap: 6px;
  padding: 12px;
}
.featured-gallery span, .media-card span, .file-row span, .post-card span {
  color: var(--muted);
  font-size: 13px;
}

.video-studio {
  max-width: 1100px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  margin: 0 auto;
}
.video-player-card, .video-playlist {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.player-screen {
  position: relative;
  background: linear-gradient(135deg, #dff3ff, #fff2f7);
}
#mainVideo {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 0;
  background: #dbeefa;
  object-fit: contain;
}
.video-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(238, 248, 255, 0.84)),
    url("https://images.unsplash.com/photo-1542051841857-5f90071e7989?auto=format&fit=crop&w=1200&q=72");
  background-size: cover;
  background-position: center;
}
.player-info {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}
.player-info div {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.player-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-info span {
  color: var(--muted);
  font-size: 13px;
}
.player-controls {
  display: grid;
  grid-template-columns: 42px auto minmax(130px, 1fr) auto 42px 110px 82px 42px;
  gap: 10px;
  align-items: center;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
}
.player-button {
  width: 40px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--sky-deep);
  cursor: pointer;
  font-weight: 900;
}
.player-controls span {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.player-controls input[type="range"] {
  padding: 0;
  accent-color: var(--sky-deep);
}
.player-controls select {
  min-height: 40px;
  border: 1px solid #c9dced;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 8px;
}
.disabled-link {
  opacity: 0.45;
  pointer-events: none;
}
.danger {
  min-height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(216, 91, 104, 0.38);
  border-radius: 8px;
  background: #fff4f5;
  color: #c24152;
  padding: 9px 13px;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}
.danger:hover {
  background: #ffe7ea;
  border-color: rgba(216, 91, 104, 0.62);
}
.playlist-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.playlist-head span {
  color: var(--muted);
  font-size: 13px;
}
.playlist-list {
  max-height: 560px;
  overflow: auto;
  padding: 10px;
}
.playlist-item {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  padding: 10px;
  text-align: left;
  cursor: pointer;
}
.playlist-item:hover, .playlist-item.active {
  border-color: rgba(116, 199, 238, 0.5);
  background: #eef8ff;
}
.playlist-thumb {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #dff3ff, #fff0f6);
  color: var(--sky-deep);
  font-weight: 900;
}
.playlist-item span:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.playlist-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.playlist-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.playlist-item small {
  color: var(--muted);
}

.file-list, .post-list {
  max-width: 1100px;
  display: grid;
  gap: 12px;
  margin: 0 auto;
}
.file-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
}
.file-row div {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.row-actions {
  display: flex !important;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}
.forum-form {
  max-width: 1100px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin: 0 auto 18px;
  padding: 16px;
}
.forum-form textarea, .forum-form .form-message { grid-column: 1 / -1; }
.forum-form textarea {
  min-height: 130px;
  resize: vertical;
}
.post-card, .empty { padding: 16px; }
.post-card h3 { margin: 0 0 8px; }
.post-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}
.post-head h3 { min-width: 0; }
.reply-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.reply-panel > strong {
  color: var(--sky-deep);
  font-size: 14px;
}
.reply-list {
  display: grid;
  gap: 8px;
}
.reply-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(116, 199, 238, 0.28);
  border-radius: 8px;
  background: rgba(238, 248, 255, 0.68);
  padding: 10px 12px;
}
.reply-card p {
  margin: 0;
  line-height: 1.7;
}
.reply-card div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.reply-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}
.reply-form textarea {
  min-height: 72px;
  resize: vertical;
}
.reply-form .form-message {
  grid-column: 1 / -1;
}
.compact {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
}
.no-scroll {
  overflow: hidden;
}
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(21, 33, 44, 0.32);
  backdrop-filter: blur(4px);
}
.lightbox.hidden {
  display: none;
}
.lightbox figure {
  width: min(760px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 32px));
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 70px rgba(39, 61, 78, 0.28);
}
.lightbox img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 8px;
  object-fit: contain;
  background: #f4fbff;
}
.lightbox figcaption {
  min-height: 20px;
  color: var(--ink);
  font-weight: 900;
  text-align: center;
}
.lightbox-close {
  position: absolute;
  top: calc(50% - min(560px, calc(100vh - 32px)) / 2 - 14px);
  right: calc(50% - min(760px, calc(100vw - 32px)) / 2 - 14px);
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font-size: 26px;
  font-weight: 900;
  cursor: pointer;
}

.game-shell {
  max-width: 1100px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  margin: 0 auto;
}
canvas, video {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f2f8ff;
}
#gameCanvas, #mathCanvas, #boardCanvas { width: 100%; }
.side-panel, .formula-panel {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 18px;
}
.side-panel span {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.vr-stage {
  position: relative;
  max-width: 1100px;
  height: 430px;
  overflow: hidden;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(116, 199, 238, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 159, 189, 0.16) 1px, transparent 1px),
    radial-gradient(circle at 50% 48%, rgba(116, 199, 238, 0.26), transparent 34%),
    #ffffff;
  background-size: 44px 44px, 44px 44px, auto, auto;
  box-shadow: var(--shadow);
  perspective: 900px;
}
.vr-ring {
  position: absolute;
  inset: 72px 20%;
  border: 2px solid rgba(47, 141, 199, 0.58);
  border-radius: 50%;
  animation: spin 9s linear infinite;
}
.ring-b { border-color: rgba(255, 159, 189, 0.72); animation-duration: 12s; }
.ring-c { border-color: rgba(127, 199, 165, 0.72); animation-duration: 15s; }
.vr-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 118px;
  height: 118px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff, #e7f7ff);
  color: var(--sky-deep);
  font-size: 34px;
  font-weight: 900;
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
}
@keyframes spin { to { transform: rotateX(66deg) rotateZ(360deg); } }

.teaching-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
}
.whiteboard {
  grid-column: 1 / -1;
  padding: 16px;
}
.board-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.auth-dialog {
  width: min(420px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.auth-dialog::backdrop {
  background: rgba(90, 123, 156, 0.3);
  backdrop-filter: blur(8px);
}
.auth-dialog form {
  display: grid;
  gap: 14px;
}
.locked .tool-band, .locked .teaching-layout {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}
.access-gate {
  position: fixed;
  z-index: 9;
  inset: 92px clamp(16px, 5vw, 72px) auto;
  max-width: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  padding: 24px;
  backdrop-filter: blur(18px);
}
.access-gate h2 {
  margin: 0 0 8px;
  font-size: clamp(26px, 4vw, 44px);
}
.access-gate p { color: var(--muted); }
.close {
  justify-self: end;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
  color: var(--sky-deep);
  cursor: pointer;
}
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tabs button {
  background: var(--paper-soft);
  color: var(--muted);
}
.tabs .active {
  background: #eaf7ff;
  border-color: var(--sky);
  color: var(--sky-deep);
}

@media (max-width: 920px) {
  [data-shell] { grid-template-columns: 1fr auto; }
  .nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
  }
  .page { padding-top: 110px; }
  .portal-grid, .media-grid, .featured-gallery { grid-template-columns: repeat(2, 1fr); }
  .japan-band { grid-template-columns: 1fr; }
  .japan-cards, .quiz-results { grid-template-columns: 1fr; }
  .game-shell, .teaching-layout, .video-studio { grid-template-columns: 1fr; }
  .player-controls {
    grid-template-columns: 42px auto 1fr auto 42px;
  }
  #volumeBar, #speedSelect, #fullscreenBtn {
    grid-column: span 1;
  }
}
@media (max-width: 620px) {
  .user-badge { display: none; }
  .portal-grid, .media-grid, .featured-gallery, .upload-form, .forum-form, .quiz-form { grid-template-columns: 1fr; }
  .hero { padding-top: 150px; }
  .access-gate { inset: 132px 16px auto; }
  .file-row {
    align-items: stretch;
    flex-direction: column;
  }
  .player-info, .player-controls {
    grid-template-columns: 1fr;
  }
  .player-info {
    align-items: stretch;
  }
  .player-button {
    width: 100%;
  }
}
