/* 遊戲大廳（電視遊戲機式）：
   上方遊戲列（選中者在最左、放大、白色光圈）＋整個畫面是所選遊戲的闊幅主視覺＋左下標題及「開始」＋右下功能鍵 */
.screen-lobby { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); min-height: 0; }

/* ---------- 遊戲列 ---------- */
.rail-block { grid-row: 1; grid-column: 1; min-width: 0; padding-top: clamp(2px, 1vh, 10px); }
.rail-head { display: flex; align-items: center; gap: 14px; padding: 0 var(--gutter); }
.rail-count { display: inline-flex; align-items: center; gap: 16px; font-family: var(--font-num); font-size: 15px; font-weight: 700; color: var(--text-2); }
.rail-count span { display: inline-flex; align-items: center; gap: 6px; }
.rail-count svg { width: 18px; height: 18px; }

.rail-viewport {
  position: relative;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-left: var(--gutter);
  padding: clamp(30px, 4vh, 44px) 0 clamp(26px, 3.4vh, 40px);
  margin: clamp(-18px, -1.6vh, -10px) 0;
  scrollbar-width: none; overscroll-behavior-x: contain;
  cursor: grab; touch-action: pan-x pan-y;
}
.rail-viewport::-webkit-scrollbar { display: none; }
.rail-viewport.is-dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.rail-viewport.is-dragging .tile { pointer-events: none; }
.rail { display: flex; align-items: center; gap: var(--tile-gap); list-style: none; margin: 0; padding: 0 0 0 var(--gutter); width: max-content; }
.rail-item { flex: none; scroll-snap-align: start; }
.rail-spacer { flex: none; }

.tile {
  position: relative; display: block;
  width: var(--tile-w); aspect-ratio: 500 / 580;
  padding: 0; border: 0; border-radius: 22px; background: transparent;
  transform-origin: 0% 50%; transform: scale(.84);
  transition: transform .45s var(--ease-spring), opacity .3s, filter .3s;
  opacity: .78; filter: saturate(.85) brightness(.85); cursor: pointer;
}
.tile:hover { opacity: .95; filter: none; }
.tile.is-selected { transform: scale(1.06); opacity: 1; filter: none; }
/* 選中：白色光圈＋呼吸柔光 */
.tile::before {
  content: ""; position: absolute; inset: -7px; border-radius: 28px;
  border: 3px solid var(--focus);
  box-shadow: 0 0 30px 4px rgba(255, 255, 255, .35);
  opacity: 0; transform: scale(.96); transition: opacity .25s, transform .35s var(--ease);
  pointer-events: none;
}
.tile.is-selected::before { opacity: 1; transform: none; animation: ring-breathe 2.6s ease-in-out infinite; }
.tile:focus-visible { outline: none; box-shadow: none; }
.tile:focus-visible::after { content: ""; position: absolute; inset: -13px; border-radius: 34px; border: 2px solid var(--yellow); pointer-events: none; }
.tile-cover { position: absolute; inset: 0; border-radius: 20px; overflow: hidden; box-shadow: 0 14px 26px -14px rgba(0, 0, 0, .7); }
.tile.is-selected .tile-cover { box-shadow: 0 18px 34px -16px rgba(0, 0, 0, .75); }
.tile-num { position: absolute; z-index: 2; left: 9px; top: 9px; padding: 2px 8px; border-radius: 999px; font-family: var(--font-num); font-size: 11px; font-weight: 700; letter-spacing: .08em; color: #fff; background: rgba(13, 7, 23, .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.tile-title {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 30px 12px 11px;
  font-size: 14px; font-weight: 900; line-height: 1.3; text-align: left;
  color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
  background: linear-gradient(180deg, transparent, rgba(13, 7, 23, .85));
  border-radius: 0 0 20px 20px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .35s var(--ease);
}
.tile.is-selected .tile-title, .tile:hover .tile-title { opacity: 1; transform: none; }
.tile.is-locked .tile-cover { filter: grayscale(1) brightness(.8); }
.tile-lock {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%);
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; z-index: 2;
  background: rgba(13, 7, 23, .6); color: #fff; box-shadow: inset 0 0 0 1px var(--stroke-2);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.tile-lock svg { width: 20px; height: 20px; }

.rail-foot { display: flex; align-items: center; gap: 14px; padding: 0 var(--gutter); flex-wrap: wrap; }
.dots { display: flex; align-items: center; gap: 4px; }
.dot { position: relative; width: 22px; height: 22px; border: 0; padding: 0; background: transparent; display: grid; place-items: center; }
.dot::before { content: ""; width: 8px; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .3); transition: width .3s var(--ease), background-color .3s; }
.dot.is-current::before { width: 26px; background: var(--text); box-shadow: 0 0 12px rgba(255, 255, 255, .5); }
.dot.is-locked::before { background: rgba(255, 255, 255, .12); }
.dot:focus-visible { outline: none; box-shadow: none; }
.dot:focus-visible::before { box-shadow: 0 0 0 2px var(--yellow); }
.rail-arrows { display: flex; gap: 6px; }
.arrow-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--stroke-2); display: grid; place-items: center; transition: transform .2s var(--ease), opacity .2s, background-color .2s; }
.arrow-btn svg { width: 18px; height: 18px; }
.arrow-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .22); }
.arrow-btn:active:not(:disabled) { transform: scale(.9); }
.arrow-btn:disabled { opacity: .25; }
.arrow-btn:focus-visible { outline: none; box-shadow: var(--glow-focus); }

/* ---------- 焦點遊戲：左下標題、說明、開始 ---------- */
.hero {
  --accent: var(--purple);
  grid-row: 2; grid-column: 1;
  position: relative;
  display: flex; align-items: flex-end;
  padding: 0 var(--gutter) clamp(18px, 4.4vh, 48px);
  min-height: 0;
  overflow-x: clip;
}
.hero-info { min-width: 0; max-width: min(760px, 58vw); }
.hero-kicker { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hero-num { font-family: var(--font-num); font-size: 14px; font-weight: 700; letter-spacing: .18em; color: var(--text-2); font-variant-numeric: tabular-nums; }
.hero-category {
  font-size: 14px; font-weight: 900; letter-spacing: .14em; color: #fff;
  padding: 5px 14px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 85%, #000);
  box-shadow: 0 0 24px -4px color-mix(in srgb, var(--accent) 90%, transparent), inset 0 0 0 1px rgba(255, 255, 255, .25);
}
.hero-title {
  margin: clamp(10px, 1.8vh, 18px) 0 clamp(8px, 1.4vh, 14px);
  font-size: clamp(32px, min(3.6vw, 6.4vh), 64px); font-weight: 900; line-height: 1.12; letter-spacing: .03em;
  color: #fff;
  text-shadow: 0 4px 30px rgba(0, 0, 0, .65), 0 2px 4px rgba(0, 0, 0, .4);
}
.hero-desc { font-size: clamp(15px, 2.1vh, 19px); color: var(--text-2); line-height: 1.7; max-width: 34em; text-shadow: 0 2px 10px rgba(0, 0, 0, .6); }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: clamp(10px, 2vh, 18px) 0 0; padding: 0; }

.hero-actions { display: flex; align-items: center; gap: 14px; margin-top: clamp(18px, 3.4vh, 34px); }
.play-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 16px;
  min-height: 72px; min-width: 280px; padding: 10px 20px 10px 11px;
  border: 0; border-radius: 999px;
  background: linear-gradient(180deg, #ffe680, var(--yellow) 55%, #e6b936); color: var(--on-yellow);
  box-shadow: 0 0 46px -6px rgba(247, 208, 84, .65), inset 0 -4px 0 rgba(120, 70, 0, .2), inset 0 2px 0 rgba(255, 255, 255, .6);
  text-align: left;
  transition: transform .25s var(--ease-spring), box-shadow .2s, filter .2s;
}
.play-btn::after {
  content: ""; position: absolute; inset: -9px; border-radius: inherit;
  border: 2px solid rgba(247, 208, 84, .9); opacity: .35;
  animation: pulse-ring 2.4s var(--ease) infinite; pointer-events: none;
}
.play-btn:hover:not(:disabled) { filter: brightness(1.06); transform: scale(1.03); }
.play-btn:active:not(:disabled) { transform: scale(.97); }
.play-btn:focus-visible { outline: none; box-shadow: var(--glow-focus), 0 0 46px -6px rgba(247, 208, 84, .65); }
.play-icon { width: 52px; height: 52px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--on-yellow); color: var(--yellow); box-shadow: 0 6px 14px -4px rgba(29, 16, 48, .7); }
.play-icon svg { width: 24px; height: 24px; margin-left: 3px; }
.play-text { display: flex; flex-direction: column; line-height: 1.2; margin-right: auto; }
.play-text strong { font-size: 24px; font-weight: 900; letter-spacing: .2em; }
.play-text small { font-size: 13px; font-weight: 900; opacity: .7; }
.play-kbd { background: rgba(29, 16, 48, .14); color: var(--on-yellow); box-shadow: inset 0 0 0 1px rgba(29, 16, 48, .3); }
.play-btn:disabled { background: rgba(255, 255, 255, .08); color: var(--text-2); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .22); }
.play-btn:disabled::after { display: none; }
.play-btn:disabled .play-icon { background: transparent; color: var(--text-2); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .3); }
.play-btn:disabled .play-icon svg { margin-left: 0; }
.play-btn:disabled .play-kbd { display: none; }

/* 舊版的立體封面：主視覺已鋪滿整個畫面，這裏不再顯示 */
.hero-art { display: none; }

/* ---------- 功能鍵（右下，只有圖示） ---------- */
.screen-lobby > .dock { position: absolute; right: var(--gutter); bottom: clamp(18px, 4.4vh, 48px); z-index: 2; }
.dock { display: flex; gap: 12px; }
.dock-btn {
  width: 58px; height: 58px; border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, .12); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--stroke-2), var(--shadow-1);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  display: grid; place-items: center; padding: 0;
  position: relative;
  transition: transform .25s var(--ease-spring), background-color .2s, box-shadow .2s;
}
.dock-btn:hover { background: rgba(255, 255, 255, .24); transform: scale(1.08); }
.dock-btn:active { transform: scale(.95); }
.dock-btn:focus-visible { outline: none; box-shadow: var(--glow-focus); transform: scale(1.08); }
.dock-icon { display: grid; place-items: center; }
.dock-icon svg { width: 24px; height: 24px; }
/* 未選頭像：小黃點提示 */
.dock-btn.has-badge::after { content: ""; position: absolute; top: 3px; right: 3px; width: 13px; height: 13px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 2px var(--bg), 0 0 12px rgba(247, 208, 84, .8); animation: pulse-dot 2s ease-in-out infinite; }

@media (max-height: 820px) and (min-width: 761px) {
  .play-btn { min-height: 64px; }
  .play-icon { width: 46px; height: 46px; }
  .dock-btn { width: 52px; height: 52px; }
}
@media (max-width: 1100px) and (min-width: 761px) {
  .hero-info { max-width: 60vw; }
  .dock { flex-direction: column; }
}

/* ---------- 窄螢幕 ---------- */
@media (max-width: 760px) {
  .screen-lobby { display: flex; flex-direction: column; padding-bottom: 120px; }
  .rail-block { order: 1; padding-top: 4px; }
  .hero { display: block; padding-top: 10px; order: 2; padding-bottom: 0; }
  .hero-info { max-width: none; }
  .hero-title { font-size: 30px; }
  .hero-actions {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; margin: 0;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(13, 7, 23, 0), var(--bg) 40%);
  }
  .play-btn { width: 100%; min-width: 0; min-height: 64px; }
  .play-kbd { display: none; }
  .screen-lobby > .dock { position: static; order: 3; align-self: center; margin: 26px var(--gutter) 0; }
}
