/* 게임 광장 (2026-11-16) game-plaza.js */
.gp{margin:4px 0 22px;padding:22px;border:1px solid var(--line,#e2e5f1);border-radius:20px;background:var(--card,#fff);color:var(--ink,#1e1b4b)}
.gp[hidden],[data-gp-replaced][hidden]{display:none!important}
.gp-head{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:14px 20px;margin-bottom:14px}
.gp-title{margin:0;font-size:22px}
.gp-lead{margin:6px 0 0;color:var(--mute,#64748b);font-size:14px;line-height:1.6}
.gp-stats{display:flex;gap:8px;flex-wrap:wrap}
.gp-stat{min-width:92px;padding:8px 12px;border-radius:12px;background:var(--card2,#f8f9ff);border:1px solid var(--line,#e2e5f1);text-align:center}
.gp-stat strong{display:block;font-size:18px}
.gp-stat span{font-size:12px;color:var(--mute,#64748b)}
.gp-tabs{display:flex;flex-wrap:wrap;gap:8px;margin:4px 0 6px}
.gp-tab{min-height:38px;padding:6px 14px;border:1px solid var(--line,#e2e5f1);border-radius:999px;background:#fff;color:var(--ink,#1e1b4b);font:inherit;font-size:14px;font-weight:600;cursor:pointer}
.gp-tab.is-on{background:#4338ca;border-color:#4338ca;color:#fff}
.gp-tab:focus-visible,.gp-go:focus-visible,.gp-manual:focus-visible{outline:3px solid #a5b4fc;outline-offset:2px}
.gp-group{margin-top:18px}
.gp-group-title{margin:0;font-size:17px}
.gp-group-note{margin:4px 0 10px;color:var(--mute,#64748b);font-size:13px}
.gp-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:14px;align-items:start}
.gp-card{display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--line,#e2e5f1);border-radius:16px;background:#fff;box-shadow:0 2px 8px rgba(30,27,75,.06)}
.gp-pic{position:relative;aspect-ratio:16/9;background:#e8ebf7;overflow:hidden}
.gp-pic img{width:100%;height:100%;object-fit:cover;display:block}
.gp-mark{position:absolute;inset:0;display:grid;place-items:center;color:#fff;font-size:40px;font-weight:800}
.gp-body{display:flex;flex-direction:column;gap:4px;padding:12px 14px 14px}
.gp-name{margin:0;font-size:16px}
.gp-desc{margin:0;color:var(--mute,#64748b);font-size:13px;line-height:1.5}
.gp-time{margin:4px 0 0;font-size:13px;font-weight:600;color:#3730a3}
.gp-time.is-new{color:var(--mute,#64748b);font-weight:500}
.gp-gate{margin:2px 0 0;font-size:12px;color:#9a3412}
.gp-gate.is-open{color:#047857}
.gp-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.gp-go,.gp-manual{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:6px 14px;border-radius:10px;font-size:14px;font-weight:700;text-decoration:none}
.gp-go{background:#4338ca;color:#fff;border:1px solid #4338ca}
.gp-go:hover{filter:brightness(1.08)}
.gp-manual{background:#fff;color:#3730a3;border:1px solid #c7d2fe}
@media(max-width:600px){.gp{padding:16px;border-radius:16px}.gp-title{font-size:20px}.gp-grid{grid-template-columns:1fr 1fr;gap:10px}.gp-body{padding:10px}.gp-desc{display:none}.gp-go,.gp-manual{flex:1 1 100%}.gp-stat{min-width:0;flex:1}}
@media(max-width:360px){.gp-grid{grid-template-columns:1fr}}
/* 첫 화면 게임 허브 (#gameHub) */
.gh{margin:0 0 18px;padding:20px;border-radius:22px;background:linear-gradient(160deg,#1e1b4b,#312e81 55%,#3b2f8f);color:#eef2ff;box-shadow:0 8px 24px rgba(30,27,75,.18)}
.gh .gp-title{color:#fff}
.gh .gp-lead{color:#c7d2fe}
.gh .gp-stat{background:rgba(255,255,255,.08);border-color:rgba(199,210,254,.25)}
.gh .gp-stat strong{color:#fff}
.gh .gp-stat span{color:#c7d2fe}
.gh-top{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:14px;margin-bottom:6px}
.gh-hero{position:relative;display:flex;flex-direction:column;justify-content:flex-end;min-height:270px;overflow:hidden;border-radius:18px;background:#0f0d2e}
.gh-hero-pic{position:absolute;inset:0}
.gh-hero-pic img{width:100%;height:100%;object-fit:cover;display:block}
.gh-hero::after{content:"";position:absolute;inset:0;background:linear-gradient(0deg,rgba(15,13,46,.95) 8%,rgba(15,13,46,.55) 48%,rgba(15,13,46,0) 78%)}
.gh-hero-body{position:relative;z-index:1;display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:18px 20px}
.gh-kicker{margin:0;padding:3px 10px;border-radius:999px;background:#facc15;color:#422006;font-size:12px;font-weight:800}
.gh-hero-name{margin:4px 0 0;font-size:26px;color:#fff}
.gh-hero-desc{margin:0;color:#e0e7ff;font-size:14px}
.gh .gp-time{color:#a5f3fc}
.gh .gp-gate{color:#fde68a}
.gh .gp-gate.is-open{color:#86efac}
.gh-hero-go{display:inline-flex;align-items:center;min-height:46px;margin-top:8px;padding:8px 22px;border:0;border-radius:12px;background:#facc15;color:#1e1b4b;font:inherit;font-size:16px;font-weight:800;text-decoration:none;cursor:pointer}
.gh-hero-go:hover{filter:brightness(1.06)}
.gh-side{display:flex;flex-direction:column;min-width:0}
.gh-side-title,.gh-row-title{margin:0 0 8px;font-size:16px;color:#fff}
.gh-side-list{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.gh-row{margin-top:16px}
.gh-row-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.gh-all{min-height:34px;padding:4px 12px;border:1px solid rgba(199,210,254,.45);border-radius:999px;background:transparent;color:#e0e7ff;font:inherit;font-size:13px;font-weight:700;cursor:pointer}
.gh-all:hover{background:rgba(255,255,255,.1)}
.gh-strip{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(180px,200px);gap:12px;overflow-x:auto;padding:2px 2px 10px;scroll-snap-type:x proximity;scrollbar-width:thin}
.gh-tile{display:flex;flex-direction:column;min-width:0;overflow:hidden;border:1px solid rgba(199,210,254,.2);border-radius:14px;background:rgba(255,255,255,.06);color:#eef2ff;text-decoration:none;scroll-snap-align:start;font:inherit;text-align:left;padding:0;cursor:pointer;transition:transform .12s ease,border-color .12s ease}
.gh-tile:hover{transform:translateY(-2px);border-color:#facc15}
.gh-tile:focus-visible,.gh-hero-go:focus-visible,.gh-all:focus-visible{outline:3px solid #facc15;outline-offset:2px}
.gh-tile-pic{position:relative;aspect-ratio:16/9;background:#2e2a6b;overflow:hidden}
.gh-tile-pic img{width:100%;height:100%;object-fit:cover;display:block}
.gh-tile-pic .gp-mark{font-size:30px}
.gh-tile-cap{display:flex;flex-direction:column;gap:2px;padding:8px 10px 10px}
.gh-tile-name{font-size:14px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gh-tile-sub{font-size:12px;color:#c7d2fe;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(max-width:800px){.gh-top{grid-template-columns:1fr}.gh-hero{min-height:220px}}
@media(max-width:600px){.gh{padding:14px;border-radius:16px}.gh-hero-name{font-size:22px}.gh-strip{grid-auto-columns:minmax(150px,46%)}.gh-hero-go{width:100%;justify-content:center}}
/* 6학년 과학 마스터 진행 (2026-11-16) */
.gm{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px 16px;margin:0 0 14px;padding:12px 16px;border:1px solid rgba(250,204,21,.45);border-radius:16px;background:rgba(250,204,21,.08)}
.gm-head{display:flex;align-items:center;gap:10px;min-width:0}
.gm-medal{font-size:26px;line-height:1}
.gm-title{margin:0;color:#eef2ff;font-size:15px;line-height:1.5}
.gm-title b{color:#facc15;font-size:17px}
.gm-bar{grid-column:1;display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:4px;height:10px}
.gm-bar i{border-radius:999px;background:rgba(199,210,254,.22)}
.gm-bar i.is-on{background:linear-gradient(90deg,#facc15,#f59e0b)}
.gm-chips{grid-column:1;display:flex;flex-wrap:wrap;gap:6px}
.gm-chip{padding:2px 10px;border-radius:999px;background:rgba(255,255,255,.1);color:#e0e7ff;font-size:12px;font-weight:600}
.gm-go{grid-column:2;grid-row:1/span 3;min-height:44px;padding:8px 16px;border:0;border-radius:12px;background:#facc15;color:#1e1b4b;font:inherit;font-size:14px;font-weight:800;cursor:pointer}
.gm-go:hover{filter:brightness(1.06)}
.gm-go:focus-visible{outline:3px solid #fff;outline-offset:2px}
@media(max-width:600px){.gm{grid-template-columns:1fr;padding:12px}.gm-go{grid-column:1;grid-row:auto;width:100%}}
/* ===== 2026-11-18 새 배치 (공통게임자산/hub-redesign) =====
   그림 틀 하나: 16:9, 모서리 12px, 흰 테두리. 상태는 그림 위 작은 배지. 옆으로 넘기기 없이 줄바꿈 칸. */
.gp-pic,.gh-tile-pic,.gh-card-pic{position:relative;aspect-ratio:16/9;overflow:hidden;border-radius:12px;background:#e2e8f0}
.gp-pic img,.gh-tile-pic img,.gh-card-pic img{width:100%;height:100%;object-fit:cover;display:block}
.gp-badges{position:absolute;top:8px;left:8px;right:8px;display:flex;flex-wrap:wrap;gap:4px;pointer-events:none}
.gp-badge{padding:2px 9px;border:2px solid #fff;border-radius:999px;background:#1e293b;color:#fff;font-size:11px;font-weight:800;line-height:1.5;box-shadow:0 1px 4px rgba(15,23,42,.25)}
.gp-badge.is-lock{background:#9a3412}
.gp-badge.is-open{background:#047857}
.gp-badge.is-new{background:#2563eb}
/* 모든 게임(메뉴) 카드 */
.gp-card{padding:8px;border-radius:16px}
.gp-pic{border:2px solid #fff;box-shadow:0 0 0 1px #e2e8f0}
.gp-body{padding:10px 6px 6px}
.gp-desc{color:#475569}
.gp-tab[data-group=learn].is-on{background:#2563eb;border-color:#2563eb}
.gp-tab[data-group=science].is-on{background:#16a34a;border-color:#16a34a}
.gp-tab[data-group=together].is-on{background:#ea580c;border-color:#ea580c}
.gp-group-title{display:flex;align-items:center;gap:8px}
.gp-group-title::before{content:"";width:10px;height:10px;border-radius:3px;background:#94a3b8}
.gp-group[data-group=learn] .gp-group-title::before{background:#2563eb}
.gp-group[data-group=science] .gp-group-title::before{background:#16a34a}
.gp-group[data-group=together] .gp-group-title::before{background:#ea580c}
.gp-grid{grid-template-columns:repeat(auto-fill,minmax(200px,1fr))}
@media(max-width:600px){.gp-grid{grid-template-columns:1fr 1fr}.gp-desc{display:block;font-size:12px}.gp-body{padding:8px 2px 2px}}
/* 첫 화면: 이어서 하기 + 오늘 할 것 */
.gh-today{margin:4px 0 10px}
.gh-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.gh-cards.is-three{grid-template-columns:repeat(3,minmax(0,1fr))}
.gh-card{display:flex;flex-direction:column;min-width:0;padding:8px;border:1px solid rgba(199,210,254,.22);border-radius:18px;background:rgba(255,255,255,.07)}
.gh-card[data-kind=continue]{border:2px solid #facc15;background:rgba(250,204,21,.1)}
.gh-card-pic{border:2px solid rgba(255,255,255,.9)}
.gh-card-body{display:flex;flex:1;flex-direction:column;align-items:flex-start;gap:3px;padding:10px 6px 4px}
.gh-card .gh-kicker{padding:2px 10px;border-radius:999px;background:rgba(255,255,255,.14);color:#e0e7ff;font-size:12px;font-weight:800}
.gh-card[data-kind=continue] .gh-kicker{background:#facc15;color:#422006}
.gh-card-name{margin:2px 0 0;color:#fff;font-size:19px;line-height:1.3;word-break:keep-all}
.gh-card-desc{margin:0;color:#c7d2fe;font-size:13px;line-height:1.45;word-break:keep-all}
.gh-card .gp-time{margin:0;font-size:12px}
.gh-card-go{display:inline-flex;align-items:center;justify-content:center;width:100%;min-height:46px;margin-top:auto;padding:8px 14px;border:0;border-radius:12px;background:#fff;color:#312e81;font:inherit;font-size:15px;font-weight:800;text-decoration:none;cursor:pointer}
.gh-card-body .gh-card-go{margin-top:10px}
.gh-card[data-kind=continue] .gh-card-go{background:#facc15;color:#1e1b4b}
.gh-card-go:hover{filter:brightness(1.05)}
.gh-card-go:focus-visible,.gh-more:focus-visible{outline:3px solid #facc15;outline-offset:2px}
/* 모든 게임 펼치기 */
.gh-all-wrap{margin-top:14px}
.gh-more{display:flex;align-items:center;gap:8px;width:100%;min-height:48px;padding:8px 16px;border:1px solid rgba(199,210,254,.35);border-radius:14px;background:rgba(255,255,255,.06);color:#fff;font:inherit;font-size:16px;font-weight:800;cursor:pointer}
.gh-more b{padding:1px 9px;border-radius:999px;background:rgba(255,255,255,.16);font-size:13px}
.gh-more-arrow{margin-left:auto;font-style:normal;color:#c7d2fe}
.gh-more:hover{background:rgba(255,255,255,.11)}
.gh-row{margin-top:16px}
.gh-row-head{justify-content:flex-start;gap:8px;margin-bottom:8px}
.gh-row-title{display:flex;align-items:center;gap:8px;margin:0}
.gh-row-title::before{content:"";width:10px;height:10px;border-radius:3px;background:#94a3b8}
.gh-row[data-group=learn] .gh-row-title::before{background:#60a5fa}
.gh-row[data-group=science] .gh-row-title::before{background:#4ade80}
.gh-row[data-group=together] .gh-row-title::before{background:#fb923c}
.gh-row-count{color:#c7d2fe;font-size:13px;font-weight:700}
.gh-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
.gh-tile{padding:6px;border-radius:14px}
.gh-tile-pic{border:2px solid rgba(255,255,255,.9)}
.gh-tile-cap{padding:7px 4px 4px}
.gh-tile-name,.gh-tile-sub{white-space:normal;overflow:visible;text-overflow:clip;word-break:keep-all;line-height:1.35}
.gh-strip{grid-auto-flow:row;grid-auto-columns:auto;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));overflow:visible}
@media(max-width:1100px){.gh-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.gh-cards.is-three{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){.gh-cards.is-three{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){
  .gh-cards,.gh-cards.is-three{grid-template-columns:1fr;gap:8px}
  .gh-card{display:grid;grid-template-columns:118px minmax(0,1fr);align-items:center;gap:0 10px;padding:8px}
  .gh-card-body{padding:0}
  .gh-card-name{font-size:17px}
  .gh-card-go{min-height:40px;font-size:14px}
  .gh-card-body .gh-card-go{margin-top:6px}
  .gh-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
.gm.is-slim{display:flex;padding:8px 14px}
/* 2026-11-18 넓은 화면: 마스터 진행을 한 줄로(첫 화면에 카드 단추까지 보이게), 카드 단추 높이 맞춤 */
.gh-card-body .gh-card-go{margin-top:auto}
.gh-card-body .gp-time{margin-bottom:8px}
.gh-card-body .gh-card-desc{margin-bottom:8px}
@media(min-width:900px){
  .gh .gp-head{margin-bottom:10px}
  .gm{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;padding:10px 16px;margin-bottom:12px}
  .gm-head{flex:none}
  .gm-medal{font-size:22px}
  .gm-bar{flex:1 1 200px;min-width:160px}
  .gm-chips{flex:none}
  .gm-go{min-height:38px;padding:6px 14px}
}
/* 1024px 같은 작은 노트북에서도 카드 넷을 한 줄로, 900px 아래는 그림 왼쪽·글 오른쪽 두 칸 */
@media(max-width:1100px){.gh-cards{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.gh-cards.is-three{grid-template-columns:repeat(3,minmax(0,1fr))}.gh-card-name{font-size:17px}}
@media(max-width:900px){
  .gh-cards,.gh-cards.is-three{grid-template-columns:repeat(2,minmax(0,1fr))}
  .gh-card{display:grid;grid-template-columns:42% minmax(0,1fr);align-items:center;gap:0 10px}
  .gh-card-body{padding:0}
}
@media(max-width:560px){.gh-cards,.gh-cards.is-three{grid-template-columns:1fr}.gh-card{grid-template-columns:118px minmax(0,1fr)}}
/* 2026-11-18 위쪽 바로가기(1학기 복습·과학 타자 게임)는 첫 화면 「오늘 할 것」과 겹쳐서 게임 허브가 그려지면 숨긴다(「게임 바로가기」 메뉴는 그대로) */
body:has(#gameHub .gh-cards) .review-top-link{display:none}
/* 2026-11-22 게임 안내 창(game-guide.js) 단추 자리 */
.gp-guide{margin-top:8px}
.gh-card-body .gp-guide{margin:2px 0 0}
.gh-card-body .gp-guide .gg-btn{min-height:32px;padding:3px 10px;font-size:12.5px}
.gh-tile-wrap{position:relative;min-width:0}
.gh-tile-wrap>.gh-tile{height:100%}
.gh-tile-guide{position:absolute;top:12px;right:12px;z-index:2;min-height:28px;padding:2px 10px;border:1px solid rgba(255,255,255,.85);border-radius:999px;background:rgba(15,13,46,.72);color:#fff;font:inherit;font-size:12px;font-weight:800;cursor:pointer}
.gh-tile-guide:hover{background:#4338ca}
.gh-tile-guide:focus-visible{outline:3px solid #facc15;outline-offset:2px}
.gp-guide-all{display:inline-flex;margin-top:6px;font-size:14px;font-weight:700;color:#3730a3}
