/* ========== 全局重置与基础 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(135deg, #0d0221 0%, #1a0533 20%, #2d0a5c 40%, #1a0a4a 60%, #0d0221 100%);
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
  color: #ffffff;
  height: 100vh;
  overflow: hidden;
  user-select: none;
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

#app {
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* ========== 背景粒子 ========== */
#particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  font-size: 20px;
  opacity: 0.15;
  animation: floatUp linear infinite;
  pointer-events: none;
}

@keyframes floatUp {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0.1;
  }
  50% {
    opacity: 0.25;
  }
  100% {
    transform: translateY(-10vh) rotate(360deg);
    opacity: 0;
  }
}

/* ========== 屏幕切换 ========== */
.screen {
  display: none;
  width: 100%;
  height: 100vh;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
  padding: 30px;
}

.screen.active {
  display: flex;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========== 首页 ========== */
.home-content {
  text-align: center;
  max-width: 480px;
  padding: 50px 40px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(88, 20, 180, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.logo-wrapper {
  margin-bottom: 16px;
}

.logo-icon {
  font-size: 72px;
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(138, 43, 226, 0.5));
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}

.title {
  font-size: 46px;
  font-weight: 800;
  background: linear-gradient(135deg, #a855f7, #6366f1, #06b6d4);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientText 3s ease infinite;
  letter-spacing: 0;
  margin-bottom: 8px;
}

@keyframes gradientText {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.subtitle {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 12px;
  letter-spacing: 0;
}

.description {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 20px;
}

.home-crew {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.staff-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
}

.staff-pill-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 18px;
}

.corgi-avatar {
  --corgi-size: 34px;
  --prop-color: #22d3ee;
  --fur: #d9822b;
  --fur-dark: #a3561d;
  --mask: #fff8e5;
  --ear-inner: #ffd2a8;
  position: relative;
  width: var(--corgi-size);
  height: var(--corgi-size);
  overflow: visible;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 78%, var(--mask) 0 30%, var(--fur) 31% 72%, var(--fur-dark) 73%);
  box-shadow: inset 0 -3px 0 rgba(70, 31, 17, 0.16), 0 5px 14px rgba(0, 0, 0, 0.18);
}

.corgi-ear {
  position: absolute;
  top: -8%;
  width: 28%;
  height: 34%;
  background: var(--fur);
  border: 2px solid rgba(92, 43, 20, 0.34);
  border-radius: 70% 70% 20% 20%;
  z-index: 0;
}

.corgi-ear::after {
  content: "";
  position: absolute;
  inset: 26% 22% 12%;
  border-radius: inherit;
  background: var(--ear-inner);
}

.corgi-ear-left {
  left: 8%;
  transform: rotate(-27deg);
}

.corgi-ear-right {
  right: 8%;
  transform: rotate(27deg);
}

.corgi-head {
  position: absolute;
  inset: 8% 7% 5%;
  border-radius: 48% 48% 45% 45%;
  background: var(--fur);
  z-index: 1;
}

.corgi-mask {
  position: absolute;
  left: 50%;
  bottom: 5%;
  width: 55%;
  height: 55%;
  transform: translateX(-50%);
  border-radius: 48% 48% 54% 54%;
  background: var(--mask);
  z-index: 2;
}

.corgi-eye {
  position: absolute;
  top: 43%;
  width: 9%;
  height: 10%;
  border-radius: 50%;
  background: #20120e;
  z-index: 3;
}

.corgi-eye-left {
  left: 34%;
}

.corgi-eye-right {
  right: 34%;
}

.corgi-nose {
  position: absolute;
  left: 50%;
  top: 57%;
  width: 14%;
  height: 10%;
  transform: translateX(-50%);
  border-radius: 50% 50% 58% 58%;
  background: #2b1712;
  z-index: 4;
}

.corgi-nose::before,
.corgi-nose::after {
  content: "";
  position: absolute;
  top: 100%;
  width: 85%;
  height: 80%;
  border-bottom: 2px solid rgba(43, 23, 18, 0.8);
}

.corgi-nose::before {
  right: 45%;
  border-radius: 0 0 0 100%;
}

.corgi-nose::after {
  left: 45%;
  border-radius: 0 0 100% 0;
}

.corgi-prop {
  position: absolute;
  right: -12%;
  top: -13%;
  z-index: 5;
  min-width: 43%;
  height: 43%;
  display: grid;
  place-items: center;
  padding: 0 2px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  background: var(--prop-color);
  color: #fff;
  font-size: calc(var(--corgi-size) * 0.22);
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.corgi-question {
  --prop-color: #22d3ee;
  --fur: #d9822b;
  --fur-dark: #934818;
  --mask: #fff8e5;
  --ear-inner: #ffd2a8;
}

.corgi-score {
  --prop-color: #facc15;
  --fur: #c17b45;
  --fur-dark: #744222;
  --mask: #fff1d6;
  --ear-inner: #f6bd86;
}

.corgi-art {
  --prop-color: #ec4899;
  --fur: #f2a7b7;
  --fur-dark: #b95f78;
  --mask: #fff7fb;
  --ear-inner: #ffd2df;
}

.corgi-timer {
  --prop-color: #6366f1;
  --fur: #8c7af0;
  --fur-dark: #4c3a9b;
  --mask: #f1efff;
  --ear-inner: #d6d0ff;
}

.corgi-mistake {
  --prop-color: #fb923c;
  --fur: #6b7280;
  --fur-dark: #374151;
  --mask: #f8fafc;
  --ear-inner: #d1d5db;
}

.home-features {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.home-actions,
.doghouse-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.feature-item {
  padding: 6px 14px;
  background: rgba(168, 85, 247, 0.15);
  border-radius: 20px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

/* ========== 按钮通用 ========== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 40px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
  letter-spacing: 1px;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.6);
}

.btn-primary:active {
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* ========== 难度选择 ========== */
.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 650px;
  margin-bottom: 30px;
}

.screen-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.screen-header h2 {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #a855f7, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-spacer {
  width: 60px;
}

.btn-back {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.difficulty-cards {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.grade-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  width: min(760px, 100%);
}

.grade-card {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 26px 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  text-align: center;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.grade-card:hover {
  transform: translateY(-7px);
  border-color: rgba(34, 211, 238, 0.36);
  box-shadow: 0 16px 38px rgba(34, 211, 238, 0.16);
}

.grade-icon {
  font-size: 42px;
}

.grade-card h3 {
  color: #fff;
  font-size: 24px;
  font-weight: 900;
}

.grade-card p {
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.selected-grade {
  margin: -12px 0 22px;
  padding: 7px 14px;
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.1);
  color: #22d3ee;
  font-size: 13px;
  font-weight: 900;
}

/* ========== 狗窝页面 ========== */
#screen-doghouse {
  align-items: flex-start;
  overflow-y: auto;
}

.doghouse-content {
  width: min(1120px, 100%);
  padding: 8px 0 26px;
}

.doghouse-header {
  max-width: 1120px;
  margin: 0 auto 24px;
}

.doghouse-scene {
  position: relative;
  height: min(620px, calc(100vh - 206px));
  min-height: 430px;
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 30%, rgba(34, 211, 238, 0.18), transparent 48%),
    rgba(13, 2, 33, 0.48);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

#doghouse-overview-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.doghouse-room-chips {
  position: absolute;
  left: 50%;
  bottom: 16px;
  display: flex;
  justify-content: center;
  gap: 8px;
  width: min(92%, 650px);
  transform: translateX(-50%);
  pointer-events: none;
}

.room-chip {
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(13, 2, 33, 0.64);
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  pointer-events: auto;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.room-chip:hover,
.room-chip.active {
  transform: translateY(-1px);
  background: rgba(34, 211, 238, 0.2);
  color: #fff;
}

.kennel-card {
  min-width: 0;
  position: relative;
  padding-top: 34px;
}

.kennel-roof {
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  height: 58px;
  background: linear-gradient(135deg, #ef4444, #fb923c);
  clip-path: polygon(50% 0, 100% 52%, 100% 100%, 0 100%, 0 52%);
  filter: drop-shadow(0 7px 10px rgba(0, 0, 0, 0.2));
}

.kennel-room {
  position: relative;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 40px 12px 14px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff3d2, #d9a15f);
  box-shadow: inset 0 -18px 0 rgba(124, 58, 35, 0.13), 0 12px 24px rgba(0, 0, 0, 0.18);
}

.room-decor {
  position: absolute;
  left: 50%;
  top: 54px;
  width: 96px;
  height: 72px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 1;
}

.kennel-nameplate {
  position: absolute;
  top: 14px;
  left: 12px;
  right: 12px;
  overflow: hidden;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(55, 31, 19, 0.72);
  color: #fff8e5;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.puppy {
  position: relative;
  width: 112px;
  height: 118px;
  margin: 24px auto 12px;
  z-index: 2;
}

.puppy-head {
  --corgi-size: 68px;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
}

.puppy-body {
  --body-fur: #d9822b;
  --body-dark: #b86625;
  --paw: #fff8e5;
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 86px;
  height: 62px;
  transform: translateX(-50%);
  border-radius: 42px 42px 24px 24px;
  background:
    radial-gradient(circle at 29% 82%, var(--paw) 0 9px, transparent 10px),
    radial-gradient(circle at 71% 82%, var(--paw) 0 9px, transparent 10px),
    linear-gradient(180deg, var(--body-fur), var(--body-dark));
  box-shadow: inset 0 -5px 0 rgba(70, 31, 17, 0.14);
}

.puppy-body::before,
.puppy-body::after {
  content: "";
  position: absolute;
  bottom: -2px;
  width: 18px;
  height: 18px;
  border-radius: 10px 10px 6px 6px;
  background: var(--paw);
}

.puppy-body::before {
  left: 19px;
}

.puppy-body::after {
  right: 19px;
}

.puppy-tail {
  position: absolute;
  right: -12px;
  top: 10px;
  width: 24px;
  height: 17px;
  border-radius: 999px 999px 999px 0;
  background: var(--paw);
  transform: rotate(-25deg);
}

.puppy-question .puppy-body {
  --body-fur: #d9822b;
  --body-dark: #b86625;
  --paw: #fff8e5;
}

.puppy-score .puppy-body {
  --body-fur: #c17b45;
  --body-dark: #744222;
  --paw: #fff1d6;
}

.puppy-art .puppy-body {
  --body-fur: #f2a7b7;
  --body-dark: #b95f78;
  --paw: #fff7fb;
}

.puppy-timer .puppy-body {
  --body-fur: #8c7af0;
  --body-dark: #4c3a9b;
  --paw: #f1efff;
}

.puppy-mistake .puppy-body {
  --body-fur: #6b7280;
  --body-dark: #374151;
  --paw: #f8fafc;
}

.kennel-copy {
  width: 100%;
  display: grid;
  gap: 5px;
  text-align: center;
}

.kennel-copy strong {
  overflow: hidden;
  color: #3b1f14;
  font-size: 15px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kennel-copy span {
  min-height: 34px;
  color: rgba(59, 31, 20, 0.72);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.room-view-btn {
  width: 100%;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(59, 31, 20, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: #3b1f14;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  transition: transform 0.2s ease, background 0.2s ease;
}

.room-view-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.86);
}

.kennel-question .kennel-room { background: linear-gradient(180deg, #cffafe, #8dd8ee); }
.kennel-score .kennel-room { background: linear-gradient(180deg, #fef3c7, #e4bd58); }
.kennel-art .kennel-room { background: linear-gradient(180deg, #fce7f3, #eba2cf); }
.kennel-timer .kennel-room { background: linear-gradient(180deg, #e0e7ff, #a7b3f4); }
.kennel-mistake .kennel-room { background: linear-gradient(180deg, #ffedd5, #e6a060); }

/* ========== 3D 房间查看器 ========== */
#screen-room-viewer {
  align-items: stretch;
  padding: 18px;
}

.room-viewer-shell {
  width: min(1100px, 100%);
  height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  margin: 0 auto;
}

.room-viewer-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.room-viewer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.room-exit-btn {
  border-color: rgba(251, 146, 60, 0.35);
  background: rgba(251, 146, 60, 0.13);
}

.room-viewer-title {
  min-width: 0;
  text-align: center;
}

.room-viewer-title h2 {
  overflow: hidden;
  margin-bottom: 3px;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-viewer-title span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  font-weight: 700;
}

.room-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.room-tab {
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.room-tab:hover,
.room-tab.active {
  transform: translateY(-1px);
  background: rgba(34, 211, 238, 0.18);
  color: #fff;
}

.room-canvas-wrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 25%, rgba(34, 211, 238, 0.18), transparent 42%),
    rgba(13, 2, 33, 0.45);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
}

#room-viewer-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#room-viewer-canvas:active {
  cursor: grabbing;
}

.room-viewer-help {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(13, 2, 33, 0.62);
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
  white-space: nowrap;
}

.room-burger .kennel-roof { background: linear-gradient(135deg, #f97316, #ef4444); }
.room-aquarium .kennel-roof { background: linear-gradient(135deg, #06b6d4, #2563eb); }
.room-flower .kennel-roof { background: linear-gradient(135deg, #22c55e, #ec4899); }
.room-cake .kennel-roof { background: linear-gradient(135deg, #a855f7, #f9a8d4); }
.room-delivery .kennel-roof { background: linear-gradient(135deg, #fb923c, #64748b); }

.burger-decor {
  height: 56px;
  top: 60px;
}

.burger-decor span {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.burger-bun.top {
  top: 0;
  width: 76px;
  height: 24px;
  border-radius: 38px 38px 12px 12px;
  background:
    radial-gradient(circle at 22px 8px, #fff7ad 0 2px, transparent 3px),
    radial-gradient(circle at 42px 6px, #fff7ad 0 2px, transparent 3px),
    radial-gradient(circle at 56px 11px, #fff7ad 0 2px, transparent 3px),
    #f2b35d;
}

.burger-cheese {
  top: 24px;
  width: 78px;
  height: 13px;
  background: #facc15;
  clip-path: polygon(0 0, 100% 0, 100% 70%, 72% 70%, 63% 100%, 54% 70%, 0 70%);
}

.burger-patty {
  top: 34px;
  width: 72px;
  height: 13px;
  border-radius: 999px;
  background: #5b2c16;
}

.burger-bun.bottom {
  top: 46px;
  width: 76px;
  height: 12px;
  border-radius: 10px 10px 18px 18px;
  background: #d98b37;
}

.aquarium-decor {
  top: 52px;
  height: 78px;
  border: 3px solid rgba(255, 255, 255, 0.78);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(186, 230, 253, 0.78), rgba(14, 165, 233, 0.45)),
    radial-gradient(circle at 20% 80%, #22c55e 0 4px, transparent 5px);
  box-shadow: inset 0 -10px 0 rgba(14, 116, 144, 0.2);
}

.fish {
  position: absolute;
  width: 23px;
  height: 13px;
  border-radius: 50%;
  background: #fb923c;
}

.fish::after {
  content: "";
  position: absolute;
  right: -8px;
  top: 2px;
  border-left: 9px solid #fb923c;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.fish-one {
  left: 16px;
  top: 24px;
}

.fish-two {
  right: 18px;
  top: 42px;
  background: #facc15;
  transform: scaleX(-1);
}

.fish-two::after {
  border-left-color: #facc15;
}

.bubble {
  position: absolute;
  width: 8px;
  height: 8px;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
}

.bubble-one {
  left: 42px;
  top: 14px;
}

.bubble-two {
  right: 30px;
  top: 20px;
  width: 6px;
  height: 6px;
}

.seaweed {
  position: absolute;
  left: 12px;
  bottom: 7px;
  width: 12px;
  height: 28px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, #16a34a 0 35%, transparent 36% 64%, #22c55e 65%);
}

.flower-decor {
  top: 48px;
  height: 88px;
}

.flower,
.flower::before,
.flower::after {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f472b6;
}

.flower {
  top: 20px;
  left: 14px;
}

.flower::before,
.flower::after {
  content: "";
}

.flower::before {
  left: 13px;
  top: 5px;
  background: #f9a8d4;
}

.flower::after {
  left: 6px;
  top: 14px;
  background: #facc15;
}

.flower-two {
  left: 43px;
  top: 9px;
  background: #a78bfa;
}

.flower-three {
  left: 67px;
  top: 27px;
  background: #fb7185;
}

.leaf {
  position: absolute;
  bottom: 8px;
  width: 34px;
  height: 48px;
  border-left: 5px solid #15803d;
  border-radius: 50%;
}

.leaf-one {
  left: 23px;
  transform: rotate(-14deg);
}

.leaf-two {
  right: 20px;
  transform: rotate(14deg);
}

.cake-decor {
  top: 52px;
  height: 78px;
}

.cake-top,
.cake-layer,
.cake-base,
.cake-candle,
.cake-sparkle {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.cake-top {
  top: 18px;
  width: 58px;
  height: 18px;
  border-radius: 14px 14px 7px 7px;
  background: #f9a8d4;
}

.cake-layer {
  top: 34px;
  width: 72px;
  height: 20px;
  background: linear-gradient(90deg, #fde68a 0 16%, #fbcfe8 17% 33%, #fde68a 34% 50%, #fbcfe8 51% 67%, #fde68a 68%);
}

.cake-base {
  top: 53px;
  width: 82px;
  height: 12px;
  border-radius: 0 0 12px 12px;
  background: #a855f7;
}

.cake-candle {
  top: 0;
  width: 8px;
  height: 22px;
  border-radius: 5px;
  background: #fff7ed;
}

.cake-candle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -10px;
  width: 10px;
  height: 12px;
  transform: translateX(-50%);
  border-radius: 50% 50% 50% 0;
  background: #facc15;
  rotate: 45deg;
}

.cake-sparkle {
  width: 8px;
  height: 8px;
  background: #fff;
  clip-path: polygon(50% 0, 64% 36%, 100% 50%, 64% 64%, 50% 100%, 36% 64%, 0 50%, 36% 36%);
}

.sparkle-one {
  left: 20px;
  top: 8px;
}

.sparkle-two {
  left: 78px;
  top: 18px;
}

.delivery-decor {
  top: 56px;
  height: 76px;
}

.parcel {
  position: absolute;
  border: 2px solid rgba(92, 43, 20, 0.18);
  border-radius: 6px;
  background: #d89b55;
}

.parcel::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 4px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.38);
}

.parcel-one {
  left: 8px;
  bottom: 8px;
  width: 38px;
  height: 34px;
}

.parcel-two {
  right: 9px;
  bottom: 8px;
  width: 42px;
  height: 42px;
  background: #c8853e;
}

.parcel-three {
  left: 30px;
  top: 5px;
  width: 40px;
  height: 30px;
  background: #f3b66e;
}

.delivery-label {
  position: absolute;
  right: 17px;
  bottom: 23px;
  width: 18px;
  height: 11px;
  border-radius: 3px;
  background: #fff7ed;
}

.diff-card {
  width: 200px;
  padding: 32px 24px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  cursor: pointer;
  transition: all 0.4s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.diff-card:hover {
  transform: translateY(-8px);
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.3);
}

.diff-card[data-diff="easy"]:hover {
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: 0 12px 40px rgba(34, 211, 238, 0.2);
}

.diff-card[data-diff="medium"]:hover {
  border-color: rgba(251, 146, 60, 0.5);
  box-shadow: 0 12px 40px rgba(251, 146, 60, 0.2);
}

.diff-card[data-diff="hard"]:hover {
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 12px 40px rgba(239, 68, 68, 0.2);
}

.diff-icon {
  font-size: 44px;
  margin-bottom: 12px;
}

.diff-card h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #fff;
}

.diff-detail p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
}

/* 不同难度颜色 */
.diff-card[data-diff="easy"] h3 { color: #22d3ee; }
.diff-card[data-diff="medium"] h3 { color: #fb923c; }
.diff-card[data-diff="hard"] h3 { color: #ef4444; }

/* ========== 游戏界面 ========== */
#screen-game {
  flex-direction: column;
  padding: 20px;
}

.game-header {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 760px;
  margin-bottom: 12px;
}

.stat-block {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.3s;
}

.stat-block:hover {
  background: rgba(255, 255, 255, 0.09);
}

.stat-label {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 4px;
  letter-spacing: 1px;
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
}

.stat-unit {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  margin-left: 2px;
}

.timer-block .stat-value { color: #22d3ee; }
.streak-block .stat-value { color: #fb923c; }
.score-block .stat-value { color: #facc15; }

.game-exit-btn {
  flex: 0 0 auto;
  align-self: stretch;
  padding: 0 14px;
  border: 1px solid rgba(251, 146, 60, 0.28);
  border-radius: 14px;
  background: rgba(251, 146, 60, 0.11);
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  transition: background 0.2s ease, transform 0.2s ease;
}

.game-exit-btn:hover {
  transform: translateY(-2px);
  background: rgba(251, 146, 60, 0.18);
}

/* 计时器条 */
.timer-bar {
  width: 100%;
  max-width: 600px;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  margin-bottom: 24px;
  overflow: hidden;
}

.timer-bar-inner {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #22d3ee, #6366f1);
  border-radius: 3px;
  transition: width 1s linear;
}

.timer-bar-inner.warning {
  background: linear-gradient(90deg, #fb923c, #ef4444);
}

.timer-bar-inner.danger {
  background: #ef4444;
  animation: timerPulse 0.5s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

/* 柯基狗便利店 */
.crew-panel {
  width: 100%;
  max-width: 760px;
  margin-bottom: 18px;
}

.store-panel {
  overflow: hidden;
  padding: 10px;
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.12), rgba(255, 255, 255, 0.045));
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}

.store-sign {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 34px;
  padding: 7px 12px;
  background: linear-gradient(135deg, #22d3ee, #6366f1 56%, #facc15);
  border-radius: 12px 12px 6px 6px;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  text-shadow: 0 1px 8px rgba(13, 2, 33, 0.35);
}

.store-sign-mark,
.store-sign-sub {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(13, 2, 33, 0.25);
  font-size: 11px;
  letter-spacing: 0;
}

.store-awning {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 18px;
  margin: 0 8px 8px;
  overflow: hidden;
  border-radius: 0 0 10px 10px;
}

.store-awning span:nth-child(odd) {
  background: #fef3c7;
}

.store-awning span:nth-child(even) {
  background: #ef4444;
}

.store-rooms {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.crew-card {
  display: flex;
  position: relative;
  align-items: center;
  gap: 8px;
  min-height: 82px;
  padding: 27px 10px 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(13, 2, 33, 0.24));
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.crew-card.active {
  border-color: rgba(34, 211, 238, 0.35);
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.18), rgba(13, 2, 33, 0.24));
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.12);
}

.crew-card.success {
  border-color: rgba(34, 197, 94, 0.35);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.18), rgba(13, 2, 33, 0.24));
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.12);
}

.crew-card.warning {
  border-color: rgba(251, 146, 60, 0.42);
  background: linear-gradient(180deg, rgba(251, 146, 60, 0.19), rgba(13, 2, 33, 0.24));
  box-shadow: 0 0 18px rgba(251, 146, 60, 0.12);
}

.crew-card.danger {
  border-color: rgba(239, 68, 68, 0.45);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.2), rgba(13, 2, 33, 0.24));
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.15);
}

.room-label {
  position: absolute;
  top: 7px;
  left: 8px;
  right: 8px;
  overflow: hidden;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(13, 2, 33, 0.32);
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crew-avatar {
  --corgi-size: 46px;
  flex: 0 0 var(--corgi-size);
  width: var(--corgi-size);
  height: var(--corgi-size);
  display: grid;
  place-items: center;
}

.crew-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.crew-name,
.crew-status {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crew-name {
  font-size: 12px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.86);
}

.crew-status {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.54);
}

/* 题目区 */
.question-area {
  width: 100%;
  max-width: 600px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 40px 30px;
  margin-bottom: 20px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

.question-number {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 16px;
  letter-spacing: 2px;
}

.question-display {
  font-size: 48px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 28px;
  text-align: center;
  text-shadow: 0 0 30px rgba(168, 85, 247, 0.3);
  letter-spacing: 3px;
  min-height: 64px;
}

.question-display.story-question {
  max-width: 520px;
  font-size: 28px;
  line-height: 1.45;
  letter-spacing: 0;
}

/* 答案区域 */
.answer-area {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 560px;
  margin-bottom: 16px;
}

#answer-input {
  flex: 1;
  padding: 14px 20px;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(168, 85, 247, 0.3);
  border-radius: 14px;
  outline: none;
  transition: all 0.3s ease;
  text-align: center;
}

#answer-input:focus {
  border-color: #a855f7;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.2);
  background: rgba(255, 255, 255, 0.1);
}

#answer-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
  font-weight: 400;
  font-size: 16px;
}

/* 隐藏数字输入框的上下箭头 */
#answer-input::-webkit-outer-spin-button,
#answer-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.btn-submit {
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.btn-chatgpt {
  padding: 14px 18px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 14px;
  background: rgba(34, 211, 238, 0.11);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn-chatgpt:hover {
  transform: translateY(-2px);
  background: rgba(34, 211, 238, 0.18);
}

.chat-teacher {
  display: none;
  width: 100%;
  max-width: 560px;
  margin: -2px 0 12px;
  overflow: hidden;
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: 14px;
  background: rgba(13, 2, 33, 0.48);
  text-align: left;
}

.chat-teacher.active {
  display: block;
}

.chat-teacher-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(34, 211, 238, 0.12);
}

.chat-teacher-header strong {
  color: #fff;
  font-size: 14px;
}

.chat-teacher-header button {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.chat-teacher-body {
  padding: 12px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.65;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(124, 58, 237, 0.5);
}

.btn-submit:active {
  transform: translateY(0);
}

/* 反馈区 */
.feedback {
  min-height: 40px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  padding: 8px 0;
  transition: all 0.3s;
}

.feedback.correct {
  color: #22c55e;
}

.feedback.wrong {
  color: #ef4444;
}

.feedback.timeout {
  color: #fb923c;
}

/* ========== 进度条 ========== */
.game-progress {
  width: 100%;
  max-width: 600px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #a855f7, #6366f1);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  min-width: 50px;
  text-align: right;
}

/* ========== 结束界面 ========== */
.end-content {
  text-align: center;
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 36px 40px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(88, 20, 180, 0.3);
  animation: slideUp 0.6s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

.end-icon {
  font-size: 64px;
  margin-bottom: 10px;
  animation: bounce 1s ease infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

.end-title {
  font-size: 30px;
  font-weight: 800;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #a855f7, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.end-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

.end-stat-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 16px 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.end-stat-label {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.end-stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
}

.end-message {
  font-size: 16px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 18px;
  padding: 16px;
  background: rgba(168, 85, 247, 0.1);
  border-radius: 14px;
  border: 1px solid rgba(168, 85, 247, 0.15);
  white-space: pre-line;
}

.wrong-book {
  text-align: left;
  margin-bottom: 24px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}

.wrong-book-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.wrong-book-header h3 {
  font-size: 16px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
}

#wrong-count {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.12);
  color: #22d3ee;
  font-size: 12px;
  font-weight: 800;
}

.wrong-list {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
}

.wrong-item,
.wrong-empty {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(13, 2, 33, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.wrong-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.wrong-index {
  flex: 0 0 auto;
  color: #facc15;
  font-size: 12px;
  font-weight: 800;
}

.wrong-question {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  font-weight: 800;
}

.wrong-detail,
.wrong-empty {
  color: rgba(255, 255, 255, 0.58);
  font-size: 13px;
  line-height: 1.5;
}

.end-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
}

/* ========== 特效动画 ========== */
.flash-correct {
  animation: flashGreen 0.5s ease;
}

.flash-wrong {
  animation: flashRed 0.5s ease;
}

@keyframes flashGreen {
  0%, 100% { box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2); }
  50%      { box-shadow: 0 0 40px rgba(34, 197, 94, 0.4), 0 8px 40px rgba(0, 0, 0, 0.2); }
}

@keyframes flashRed {
  0%, 100% { box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2); }
  50%      { box-shadow: 0 0 40px rgba(239, 68, 68, 0.4), 0 8px 40px rgba(0, 0, 0, 0.2); }
}

/* 正确答案跳动 */
.bounce-answer {
  animation: answerBounce 0.4s ease;
}

@keyframes answerBounce {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  70% { transform: scale(0.97); }
  100% { transform: scale(1); }
}

/* ========== 星星 / 彩纸特效 ========== */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
  pointer-events: none;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-10px) rotate(0deg) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg) scale(0.5);
    opacity: 0;
  }
}

/* ========== 响应式 ========== */
@media (max-width: 680px) {
  .home-content {
    padding: 36px 24px;
    border-radius: 20px;
  }

  .title {
    font-size: 34px;
  }

  .home-crew {
    grid-template-columns: repeat(5, minmax(40px, 1fr));
    gap: 5px;
  }

  .staff-pill {
    font-size: 10px;
  }

  .staff-pill-icon {
    --corgi-size: 30px;
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  .difficulty-cards {
    flex-direction: column;
    gap: 14px;
  }

  .grade-cards {
    grid-template-columns: 1fr;
    width: min(300px, 100%);
    gap: 14px;
  }

  .grade-card {
    min-height: 138px;
    padding: 20px 18px;
  }

  .grade-icon {
    font-size: 34px;
  }

  .diff-card {
    width: 260px;
    padding: 24px 20px;
  }

  .doghouse-content {
    padding-bottom: 18px;
  }

  .doghouse-header {
    margin-bottom: 16px;
  }

  .doghouse-scene {
    height: min(560px, calc(100vh - 190px));
    min-height: 390px;
  }

  .doghouse-room-chips {
    bottom: 12px;
    gap: 6px;
    width: calc(100% - 18px);
  }

  .room-chip {
    flex: 1;
    padding: 8px 6px;
    font-size: 11px;
  }

  #screen-room-viewer {
    padding: 12px;
  }

  .room-viewer-shell {
    height: calc(100vh - 24px);
    gap: 10px;
  }

  .room-viewer-header {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .room-viewer-actions {
    justify-content: center;
  }

  .room-viewer-title {
    order: -1;
  }

  .room-viewer-title h2 {
    font-size: 20px;
  }

  .room-tab {
    padding: 8px 10px;
    font-size: 12px;
  }

  .room-viewer-help {
    bottom: 10px;
    font-size: 11px;
    white-space: normal;
    text-align: center;
  }

  .game-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .stat-block {
    padding: 8px 6px;
  }

  .stat-value {
    font-size: 20px;
  }

  .game-exit-btn {
    width: 100%;
    min-height: 38px;
  }

  .crew-panel {
    max-width: 520px;
  }

  .store-panel {
    padding: 8px;
  }

  .store-sign {
    gap: 6px;
    min-height: 30px;
    padding: 6px 8px;
    font-size: 15px;
  }

  .store-sign-mark,
  .store-sign-sub {
    padding: 2px 6px;
    font-size: 9px;
  }

  .store-awning {
    height: 14px;
    margin-bottom: 7px;
  }

  .store-rooms {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .crew-card {
    min-height: 68px;
    padding: 24px 8px 8px;
  }

  .crew-card:last-child {
    grid-column: 1 / -1;
  }

  .crew-avatar {
    --corgi-size: 30px;
    flex-basis: 30px;
    width: 30px;
    height: 30px;
  }

  .room-label {
    font-size: 9px;
    top: 6px;
  }

  .crew-name {
    font-size: 11px;
  }

  .crew-status {
    font-size: 10px;
  }

  .question-display {
    font-size: 36px;
  }

  .question-display.story-question {
    font-size: 22px;
    line-height: 1.45;
  }

  .answer-area {
    flex-direction: column;
    max-width: 280px;
  }

  .btn-submit {
    width: 100%;
  }

  .btn-chatgpt {
    width: 100%;
  }

  .chat-teacher {
    max-width: 280px;
  }

  .end-stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .end-content {
    padding: 28px 22px;
  }

  .wrong-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .wrong-question {
    white-space: normal;
  }

  .end-actions {
    flex-direction: column;
    align-items: center;
  }
}
