/* 课间 · 同校游戏开黑页面：沿用高端玻璃材质，不另起一套视觉 */
body[data-page="game"] #page-back { display: none !important; }
body[data-page="game"] main > header.has-pb { padding-left: 0 !important; }

.game-page {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 4px 10px calc(94px + env(safe-area-inset-bottom, 0px));
  color: var(--ink, #1d2a24);
}

.game-top {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
}

.game-back {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  flex: 0 0 42px;
  width: 42px !important;
  height: 42px !important;
  margin: 0 !important;
}

.game-school-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--muted, #66736c);
  background: rgba(255, 255, 255, .46);
  border: 1px solid rgba(255, 255, 255, .68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 11px;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-school-pill i {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: #64b58a;
  box-shadow: 0 0 0 4px rgba(100, 181, 138, .14);
}

.game-eyebrow {
  margin: 0 0 7px;
  color: var(--muted, #66736c);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.game-hero {
  padding: 6px 8px 13px;
}

.game-hero h1 {
  margin: 0;
  color: var(--ink, #1d2a24);
  font-size: clamp(30px, 8vw, 36px);
  line-height: 1.06;
  font-weight: 650;
  letter-spacing: -.055em;
}

.game-hero p:not(.game-eyebrow) {
  margin: 10px 0 0;
  max-width: 24em;
  color: var(--muted, #66736c);
  font-size: 13px;
  line-height: 1.6;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.game-tile {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 126px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 13px 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: 23px;
  background:
    radial-gradient(120% 96% at 10% 0%, rgba(255, 255, 255, .94), rgba(255, 255, 255, 0) 56%),
    linear-gradient(155deg, rgba(255, 255, 255, .78), rgba(255, 252, 247, .46));
  box-shadow:
    0 16px 34px -24px rgba(58, 47, 31, .30),
    inset 0 1px 0 rgba(255, 255, 255, .94),
    inset 0 0 0 1px rgba(255, 255, 255, .26);
  -webkit-backdrop-filter: blur(18px) saturate(1.45);
  backdrop-filter: blur(18px) saturate(1.45);
  color: var(--ink, #1d2a24);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform .22s cubic-bezier(.22, 1, .36, 1), box-shadow .22s ease, background .22s ease;
}

.game-tile::after {
  content: "";
  position: absolute;
  right: -38px;
  bottom: -52px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--g) 17%, transparent), transparent 68%);
  pointer-events: none;
}

.game-tile.is-wide {
  grid-column: 1 / -1;
  min-height: 92px;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
}

.game-tile:hover { transform: translateY(-2px); }

.game-tile:active { transform: scale(.975); }

.game-icon {
  position: relative;
  z-index: 1;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: var(--g, var(--green, #397c68));
  background:
    radial-gradient(95% 95% at 22% 0%, rgba(255, 255, 255, .99), rgba(255, 255, 255, .5) 58%, rgba(245, 239, 229, .28));
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow:
    0 7px 18px -9px rgba(58, 47, 31, .28),
    inset 0 1px 0 rgba(255, 255, 255, .98);
}

.game-icon > svg {
  width: 27px;
  height: 27px;
}

.game-icon-md {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
}

.game-tile-copy {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.game-tile-copy strong,
.game-tile-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-tile-copy strong {
  color: var(--ink, #1d2a24);
  font-size: 17px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -.03em;
}

.game-tile-copy small {
  color: var(--muted, #66736c);
  font-size: 11px;
  line-height: 1.3;
}

.game-go {
  position: absolute;
  right: 14px;
  bottom: 13px;
  z-index: 1;
  color: currentColor;
  font-size: 11px;
  opacity: .52;
}

.game-tile.is-wide .game-go {
  position: static;
  margin-left: auto;
  padding-right: 4px;
}

.game-count {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--muted, #66736c);
  background: rgba(255, 255, 255, .46);
  border: 1px solid rgba(255, 255, 255, .7);
  font-size: 10px;
  line-height: 1.25;
  white-space: nowrap;
}

.game-count.is-hot {
  color: var(--g, var(--green, #397c68));
  background: rgba(255, 255, 255, .7);
}

.game-note {
  margin: 15px 8px 0;
  color: var(--muted, #66736c);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

/* ---- 单个游戏频道 ---- */
.game-forum-head {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 9px 4px 12px;
}

.game-forum-title {
  min-width: 0;
}

.game-forum-title p {
  margin: 0 0 3px;
  color: var(--muted, #66736c);
  font-size: 11px;
}

.game-forum-title h1 {
  margin: 0;
  color: var(--ink, #1d2a24);
  font-size: 27px;
  line-height: 1.12;
  letter-spacing: -.05em;
  font-weight: 650;
}

.game-forum-title h1 span {
  margin-left: 7px;
  color: var(--muted, #66736c);
  font-size: 10px;
  letter-spacing: .1em;
  font-weight: 500;
  vertical-align: 2px;
}

.game-policy {
  margin: 0 4px 12px;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--muted, #66736c);
  background: rgba(255, 255, 255, .32);
  border: 1px solid rgba(255, 255, 255, .58);
  font-size: 11px;
  line-height: 1.55;
}

.game-feed {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 220px;
  max-height: min(50vh, 440px);
  max-height: min(50dvh, 440px);
  padding: 2px 2px 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.game-feed::-webkit-scrollbar { display: none; }

.game-loading,
.game-empty {
  margin: auto;
  padding: 26px 16px;
  color: var(--muted, #66736c);
  text-align: center;
}

.game-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.game-empty strong {
  color: var(--ink, #1d2a24);
  font-size: 17px;
  font-weight: 600;
}

.game-empty p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
}

.game-empty button,
.game-sheet-submit {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 999px;
  color: var(--ink, #1d2a24);
  background: rgba(255, 255, 255, .68);
  box-shadow: 0 8px 18px -14px rgba(34, 44, 38, .36), inset 0 1px 0 rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.game-empty-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: var(--g, var(--green, #397c68));
  background: rgba(255, 255, 255, .58);
  border: 1px solid rgba(255, 255, 255, .8);
}

.game-empty-mark svg { width: 30px; height: 30px; }

.game-msg {
  position: relative;
  align-self: flex-start;
  max-width: 88%;
  padding: 10px 12px 9px;
  border-radius: 17px 17px 17px 7px;
  color: var(--ink, #1d2a24);
  background: rgba(255, 255, 255, .58);
  border: 1px solid rgba(255, 255, 255, .72);
  box-shadow: 0 8px 20px -17px rgba(58, 47, 31, .34), inset 0 1px 0 rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.game-msg.is-mine {
  align-self: flex-end;
  border-radius: 17px 17px 7px 17px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .72), rgba(237, 246, 239, .62));
}

.game-msg.is-post {
  border-color: color-mix(in srgb, var(--g, #397c68) 26%, rgba(255, 255, 255, .72));
}

.game-msg-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}

.game-msg-meta b {
  color: var(--ink, #1d2a24);
  font-size: 11px;
  font-weight: 600;
}

.game-msg-meta time {
  color: var(--muted, #66736c);
  font-size: 10px;
}

.game-msg p {
  margin: 0;
  color: var(--ink, #1d2a24);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.game-report {
  margin-top: 4px;
  padding: 0;
  border: 0;
  color: var(--muted, #66736c);
  background: transparent;
  font: inherit;
  font-size: 10px;
  opacity: .62;
  cursor: pointer;
}

/* ---- 输入区 ---- */
.game-composer {
  position: sticky;
  bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  z-index: 12;
  margin: 15px 0 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 21px;
  background:
    radial-gradient(120% 100% at 16% 0%, rgba(255, 255, 255, .96), rgba(255, 255, 255, .56) 58%, rgba(255, 252, 247, .46));
  box-shadow: 0 16px 34px -23px rgba(58, 47, 31, .38), inset 0 1px 0 rgba(255, 255, 255, .98);
  -webkit-backdrop-filter: blur(20px) saturate(1.55);
  backdrop-filter: blur(20px) saturate(1.55);
}

.game-composer-top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  margin-bottom: 7px;
}

.game-chip {
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 999px;
  color: var(--muted, #66736c);
  background: rgba(255, 255, 255, .36);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.game-chip-main {
  color: var(--green, #397c68);
  background: rgba(255, 255, 255, .66);
  font-weight: 600;
}

.game-status {
  min-width: 0;
  margin-left: auto;
  overflow: hidden;
  color: var(--muted, #66736c);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-status.is-bad { color: #b95f59; }

.game-composer-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-input {
  min-width: 0;
  height: 38px;
  flex: 1;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 14px;
  outline: 0;
  color: var(--ink, #1d2a24);
  background: rgba(255, 255, 255, .56);
  font: inherit;
  font-size: 13px;
}

.game-input::placeholder { color: var(--muted, #66736c); opacity: .74; }

.game-send {
  width: 40px;
  height: 38px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 14px;
  color: var(--green, #397c68);
  background: rgba(255, 255, 255, .7);
  cursor: pointer;
}

.game-send:disabled { opacity: .55; }
.game-send svg { width: 18px; height: 18px; }

.game-composer-note {
  margin: 6px 2px 0;
  color: var(--muted, #66736c);
  font-size: 10px;
  line-height: 1.4;
}

/* ---- 发起开黑浮层 ---- */
body.game-sheet-open { overflow: hidden; }

.game-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
}

.game-sheet[hidden] { display: none; }

.game-sheet-veil {
  position: absolute;
  inset: 0;
  background: rgba(24, 30, 36, .20);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
}

.game-sheet-card {
  position: relative;
  width: min(100%, 420px);
  max-height: min(82vh, 620px);
  max-height: min(82dvh, 620px);
  overflow-y: auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .88);
  border-radius: 24px;
  background:
    radial-gradient(120% 100% at 12% 0%, rgba(255, 255, 255, .98), rgba(255, 255, 255, .64) 58%, rgba(249, 246, 239, .52));
  box-shadow: 0 30px 70px -26px rgba(27, 40, 34, .42), inset 0 1px 0 rgba(255, 255, 255, .98);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  backdrop-filter: blur(28px) saturate(1.6);
  color: var(--ink, #1d2a24);
}

.game-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
}

.game-sheet-head h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.15;
  letter-spacing: -.04em;
}

.game-sheet-close {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 1px solid rgba(255, 255, 255, .76);
  border-radius: 50%;
  color: var(--muted, #66736c);
  background: rgba(255, 255, 255, .52);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.game-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.game-sheet-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 10px;
  color: var(--muted, #66736c);
  font-size: 11px;
}

.game-sheet-card label > span {
  color: var(--muted, #66736c);
  font-size: 10px;
  opacity: .75;
}

.game-sheet-card input,
.game-sheet-card select {
  height: 40px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .74);
  border-radius: 12px;
  outline: 0;
  color: var(--ink, #1d2a24);
  background: rgba(255, 255, 255, .58);
  font: inherit;
  font-size: 13px;
}

.game-sheet-note {
  margin: 2px 0 13px;
  color: var(--muted, #66736c);
  font-size: 11px;
  line-height: 1.55;
}

.game-sheet-submit {
  width: 100%;
  min-height: 44px;
  color: var(--ink, #1d2a24);
  background: rgba(255, 255, 255, .82);
  font-size: 13px;
}

/* ---- 深色玻璃 ---- */
html[data-scheme="dark"] .game-school-pill,
html[data-scheme="dark"] .game-count,
html[data-scheme="dark"] .game-policy,
html[data-scheme="dark"] .game-composer,
html[data-scheme="dark"] .game-input,
html[data-scheme="dark"] .game-sheet-card {
  color: #f4efe5;
  background: rgba(20, 27, 38, .56);
  border-color: rgba(255, 255, 255, .18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .13), 0 16px 34px -24px rgba(0, 0, 0, .6);
}

html[data-scheme="dark"] .game-tile {
  color: #f4efe5;
  background:
    radial-gradient(120% 96% at 10% 0%, rgba(255, 255, 255, .17), rgba(255, 255, 255, 0) 58%),
    linear-gradient(155deg, rgba(30, 40, 53, .84), rgba(18, 24, 34, .66));
  border-color: rgba(255, 255, 255, .2);
  box-shadow: 0 16px 34px -24px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .18);
}

html[data-scheme="dark"] .game-icon {
  background: radial-gradient(95% 95% at 22% 0%, rgba(255, 255, 255, .3), rgba(255, 255, 255, .08) 62%, rgba(255, 255, 255, .04));
  border-color: rgba(255, 255, 255, .24);
}

html[data-scheme="dark"] .game-tile-copy strong,
html[data-scheme="dark"] .game-hero h1,
html[data-scheme="dark"] .game-forum-title h1,
html[data-scheme="dark"] .game-empty strong,
html[data-scheme="dark"] .game-msg-meta b,
html[data-scheme="dark"] .game-msg p,
html[data-scheme="dark"] .game-sheet-card label,
html[data-scheme="dark"] .game-sheet-head h2 {
  color: #f4efe5;
}

html[data-scheme="dark"] .game-msg {
  color: #f4efe5;
  background: rgba(28, 36, 48, .7);
  border-color: rgba(255, 255, 255, .18);
  box-shadow: 0 8px 20px -17px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .12);
}

html[data-scheme="dark"] .game-msg.is-mine {
  background: linear-gradient(145deg, rgba(45, 58, 66, .82), rgba(32, 49, 44, .7));
}

html[data-scheme="dark"] .game-empty button,
html[data-scheme="dark"] .game-sheet-submit {
  color: #f4efe5;
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .22);
}

html[data-scheme="dark"] .game-input::placeholder { color: rgba(244, 239, 229, .58); }

@media (max-width: 350px) {
  .game-page { padding-left: 7px; padding-right: 7px; }
  .game-grid { gap: 8px; }
  .game-tile { min-height: 120px; padding-left: 11px; padding-right: 11px; }
  .game-icon { width: 44px; height: 44px; flex-basis: 44px; }
  .game-icon > svg { width: 25px; height: 25px; }
  .game-tile-copy strong { font-size: 15px; }
}
