/* Poki식 타일 격자. 칸 크기는 컨테이너 폭에서 계산(--cell), 큰 타일은 2x2 */
:root {
  --bg: #5ab8f5;
  --bg2: #8fd0ff;
  --ink: #1d2a5b;
  --ink-soft: #4a5684;
  --tile: #ffffff;
  --accent: #ffd23f;
  --play: #31c45a;
  --play-dark: #1f9a40;
  --radius: 16px;
  --gap: 10px;
  --cols: 3;
  --shadow: 0 6px 12px rgba(17, 35, 90, .25);
  --title-font: "Jua", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.18) 1.5px, transparent 0) 0 0 / 22px 22px,
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%) fixed;
  color: var(--ink);
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
}
a { color: inherit; }

.wrap {
  container-type: inline-size;
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px max(16px, env(safe-area-inset-left)) 32px;
}
@media (min-width: 560px) { :root { --cols: 4; --gap: 14px; } }
@media (min-width: 820px) { :root { --cols: 6; --gap: 16px; } }
@media (min-width: 1120px) { :root { --cols: 8; } }

.grid {
  --cell: calc((100cqi - (var(--cols) - 1) * var(--gap)) / var(--cols));
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  grid-auto-rows: var(--cell);
  grid-auto-flow: dense;
  gap: var(--gap);
}

/* 로고 칸 (2x1) */
.logo {
  grid-column: span 2;
  background: var(--tile);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 14px;
  text-decoration: none;
  overflow: hidden;
}
.logo .name {
  font-family: var(--title-font);
  font-size: clamp(20px, 7.2cqi, 34px);
  line-height: 1.05;
  color: var(--ink);
  white-space: nowrap;
}
.logo .name em { font-style: normal; color: #f2a900; }
.logo .sub {
  margin-top: 4px;
  font-size: clamp(11px, 3.2cqi, 14px);
  color: var(--ink-soft);
  font-weight: 700;
}
@media (min-width: 560px) { .logo .name { font-size: clamp(20px, 4.4cqi, 34px); } .logo .sub { font-size: 13px; } }
@media (min-width: 820px) { .logo .name { font-size: clamp(20px, 2.9cqi, 34px); } }
@media (min-width: 1120px) { .logo .name { font-size: clamp(20px, 2.2cqi, 34px); } }

/* 게임 타일 */
.tile {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--tile);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 18px 8px 7px;
  background: linear-gradient(180deg, transparent, rgba(10, 20, 60, .82));
  color: #fff;
  font-family: var(--title-font);
  font-size: 15px;
  line-height: 1.15;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.tile.big { grid-column: span 2; grid-row: span 2; }
.tile.big .label { font-size: 22px; padding: 30px 10px 10px; }
.tile .badge {
  position: absolute;
  top: 8px; left: 8px;
  background: var(--accent);
  color: var(--ink);
  font-family: var(--title-font);
  font-size: 13px;
  padding: 3px 9px;
  border-radius: 999px;
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
}
@media (hover: hover) {
  .tile:hover { transform: translateY(-4px) scale(1.04); box-shadow: 0 12px 22px rgba(17, 35, 90, .32); z-index: 1; }
}
.tile:active { transform: scale(.97); }

.tile.soon {
  background: rgba(255,255,255,.35);
  box-shadow: none;
  border: 3px dashed rgba(255,255,255,.75);
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.95);
  font-family: var(--title-font);
  font-size: 15px;
  text-align: center;
  line-height: 1.2;
}
.tile.soon span { font-size: 30px; display: block; }

/* 게임 페이지: 사이트 안 플레이어 */
.home {
  display: grid;
  place-items: center;
  background: var(--tile);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  font-family: var(--title-font);
  font-size: 15px;
  color: var(--ink);
  text-align: center;
  line-height: 1.15;
}
.home span { font-size: 30px; display: block; }

.player {
  position: relative;
  margin: var(--gap) 0 0;
  height: clamp(420px, calc(100svh - 190px), 860px);
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  background: #11162e;
  box-shadow: var(--shadow);
}
.player-bg {
  position: absolute;
  inset: -40px;
  width: calc(100% + 80px);
  height: calc(100% + 80px);
  object-fit: cover;
  filter: blur(28px) brightness(.55) saturate(1.2);
}
.stage { position: relative; height: 100%; margin: 0 auto; }
.player[data-orient="portrait"] .stage { max-width: calc((100svh - 190px) * .6); }
.stage iframe { display: block; width: 100%; height: 100%; border: 0; background: #000; }

.cover {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px;
  color: #fff;
  text-align: center;
}
.cover img {
  width: min(52vw, 220px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.cover h1 {
  margin: 0;
  font-family: var(--title-font);
  font-weight: 400;
  font-size: 34px;
  text-shadow: 0 2px 6px rgba(0,0,0,.5);
}
.cover .hint { margin: 0; font-weight: 700; font-size: 15px; opacity: .9; }
.playbtn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 40px 14px 32px;
  background: var(--play);
  color: #fff;
  font-family: var(--title-font);
  font-size: 32px;
  border: 0;
  border-bottom: 6px solid var(--play-dark);
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
  cursor: pointer;
  animation: bob 1.6s ease-in-out infinite;
}
.playbtn svg { width: 1em; height: 1em; }
.playbtn:active { transform: translateY(3px); border-bottom-width: 3px; }
@keyframes bob { 50% { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) { .playbtn { animation: none; } }

/* 크게(전체 화면). 진짜 전체 화면이 안 되는 폰(아이폰)도 화면을 꽉 채운다 */
.player.full {
  position: fixed;
  inset: 0;
  z-index: 100;
  margin: 0;
  height: 100dvh;
  border-radius: 0;
}
.player.full .stage { max-width: none; }
html.lock, html.lock body { overflow: hidden; }
.exit {
  display: none;
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  left: max(8px, env(safe-area-inset-left));
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.5);
  color: #fff;
  font-size: 20px;
  line-height: 40px;
  cursor: pointer;
}
.player.full.on .exit { display: block; }

.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 16px;
  background: var(--tile);
  border-radius: 0 0 20px 20px;
  box-shadow: var(--shadow);
}
.bar-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bar-title b { font-family: var(--title-font); font-weight: 400; font-size: 22px; line-height: 1.1; }
.bar-title span { font-size: 13px; color: var(--ink-soft); font-weight: 700; }
.barbtn {
  flex: none;
  padding: 10px 16px;
  border: 0;
  border-radius: 12px;
  background: #eaf5ff;
  color: var(--ink);
  font-family: var(--title-font);
  font-size: 18px;
  cursor: pointer;
}

.info {
  margin-top: var(--gap);
  padding: 16px 18px 18px;
  background: var(--tile);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.info .tagline { margin: 0 0 12px; font-size: 18px; font-weight: 700; line-height: 1.45; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; padding: 0; list-style: none; }
.chips li {
  background: #eaf5ff;
  color: var(--ink);
  font-weight: 800;
  font-size: 14px;
  padding: 5px 11px;
  border-radius: 999px;
}
.credits { margin: 12px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 15px; }
.credits dt { color: var(--ink-soft); font-weight: 700; }
.credits dd { margin: 0; font-weight: 700; }
.credits a { color: #1a6fd0; }
.note { margin: 12px 0 0; font-size: 13px; color: var(--ink-soft); line-height: 1.5; }

.section-title {
  margin: 22px 2px 10px;
  color: #fff;
  font-family: var(--title-font);
  font-weight: 400;
  font-size: 24px;
  text-shadow: 0 2px 4px rgba(17,35,90,.35);
}

.foot {
  margin-top: 28px;
  color: rgba(255,255,255,.95);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  text-shadow: 0 1px 2px rgba(17,35,90,.3);
}
.foot p { margin: 2px 0; }
