/* The Lounge's front page, in the games' own look: paper, ink, coral, the four tile colours. */

@font-face { font-family: "Lounge Sans"; src: url("/fonts/NotoSansJP-Medium.woff2") format("woff2"); font-weight: 100 600; font-display: swap; }
@font-face { font-family: "Lounge Sans"; src: url("/fonts/NotoSansJP-Bold.woff2") format("woff2"); font-weight: 700 900; font-display: swap; }
@font-face { font-family: "Lounge Round"; src: url("/fonts/MPLUSRounded1c-ExtraBold.woff2") format("woff2"); font-weight: 100 850; font-display: swap; }
@font-face { font-family: "Lounge Round"; src: url("/fonts/MPLUSRounded1c-Black.woff2") format("woff2"); font-weight: 851 1000; font-display: swap; }

:root {
  --bg: #f6f5f2;
  --surface: #fff;
  --surface-2: #f1f0ec;
  --surface-hover: #ebeae5;
  --ink: #1e222a;
  --muted: #737a86;
  --line: rgb(30 34 42 / 0.1);
  --accent: #ff8a5c;
  --accent-text: #e2582c;
  --c-coral: #ff8a5c;
  --c-yellow: #f5b83d;
  --c-blue: #4aaef0;
  --c-green: #6cc46e;
  --c-purple: #a68af2;
  --danger: #d93a3a;
  --shadow: 0 1px 2px rgb(22 28 45 / 0.06), 0 6px 18px rgb(22 28 45 / 0.07);
  --shadow-lift: 0 2px 4px rgb(22 28 45 / 0.08), 0 14px 30px rgb(22 28 45 / 0.12);
  --font: "Lounge Sans", "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --round: "Lounge Round", "M PLUS Rounded 1c", "Lounge Sans", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16171b;
    --surface: #212328;
    --surface-2: #2a2d33;
    --surface-hover: #32353d;
    --ink: #eceef2;
    --muted: #9aa1ad;
    --line: rgb(236 238 242 / 0.1);
    --accent: #f2774b;
    --accent-text: #ff9a74;
    --c-coral: #f2774b;
    --c-yellow: #e9a92b;
    --c-blue: #3c9be0;
    --c-green: #55ad5a;
    --c-purple: #9377e6;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 6px 18px rgb(0 0 0 / 0.25);
    --shadow-lift: 0 2px 4px rgb(0 0 0 / 0.35), 0 14px 30px rgb(0 0 0 / 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  word-break: auto-phrase;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }

.c-coral { background: var(--c-coral); }
.c-yellow { background: var(--c-yellow); }
.c-blue { background: var(--c-blue); }
.c-green { background: var(--c-green); }
.c-purple { background: var(--c-purple); }

.lounge {
  max-width: 640px;
  margin: 0 auto;
  padding: max(40px, env(safe-area-inset-top)) 18px max(40px, env(safe-area-inset-bottom));
}

.hero { display: flex; flex-direction: column; align-items: center; text-align: center; }

.logo {
  --tile: clamp(38px, calc(min(84vw, 460px) / var(--letters, 4) - 6px), 96px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--tile) * 0.07);
  margin: 0;
}

.logo-row { display: flex; gap: calc(var(--tile) * 0.07); }

.logo-tile {
  display: grid;
  place-items: center;
  width: var(--tile);
  height: var(--tile);
  border-radius: calc(var(--tile) * 0.16);
  color: #fff;
  font-family: var(--round);
  font-weight: 900;
  font-size: calc(var(--tile) * 0.58);
  box-shadow: inset 0 calc(var(--tile) * -0.06) 0 rgb(0 0 0 / 0.13), 0 6px 16px rgb(22 28 45 / 0.08);
  animation: drop 0.7s var(--ease-spring) both;
  animation-delay: calc(var(--k) * 55ms + 80ms);
}

@keyframes drop { from { opacity: 0; transform: translateY(-24px) scale(0.6) rotate(-8deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.latin { margin: 18px 0 0 0.55em; font-family: var(--round); font-weight: 900; font-size: 13px; letter-spacing: 0.55em; color: var(--muted); }
.tagline { margin: 10px 0 0; font-size: 16px; font-weight: 700; color: color-mix(in srgb, var(--ink) 75%, var(--muted)); }

.me {
  margin: 28px 0 0;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: rise 0.5s var(--ease-out) 0.2s both;
}

.me-row { display: flex; align-items: center; gap: 12px; }

.me-level {
  display: grid;
  place-items: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--round);
  font-weight: 900;
  font-size: 15px;
}

.me-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.me-text b { font-family: var(--round); font-weight: 900; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text small { color: var(--muted); font-size: 12.5px; font-weight: 700; }

.chip { height: 36px; padding: 0 14px; border-radius: 999px; background: var(--surface-2); font-weight: 700; font-size: 13px; }

.bar { position: relative; height: 8px; margin-top: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--c-yellow), var(--c-coral)); transition: width 1s var(--ease-out); }
.me-note { margin: 8px 0 0; color: var(--muted); font-size: 12px; font-weight: 700; }

.section { margin: 30px 4px 12px; font-family: var(--round); font-weight: 900; font-size: 17px; }

.games { display: flex; flex-direction: column; gap: 12px; }

.card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 18px 15px 15px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s ease;
  animation: rise 0.5s var(--ease-out) both;
}

a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }

.card .tile {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  flex: none;
  border-radius: 14px;
  color: #fff;
  font-family: var(--round);
  font-weight: 900;
  font-size: 25px;
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / 0.12);
}

.card-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.card-text b { font-family: var(--round); font-weight: 900; font-size: 19px; }
.card-text small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }

.tag { padding: 6px 12px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 900; font-size: 12.5px; white-space: nowrap; }

.card.soon { opacity: 0.55; box-shadow: none; border: 1.5px dashed var(--line); background: transparent; }
.card.soon .tag { background: var(--surface-2); color: var(--muted); }

.foot { margin-top: 36px; text-align: center; color: var(--muted); font-size: 12.5px; }
.foot .small { font-size: 11px; }

.scrim { position: fixed; inset: 0; z-index: 30; background: rgb(10 12 16 / 0.36); }

.sheet {
  position: fixed;
  z-index: 31;
  left: 50%;
  top: 50%;
  width: min(460px, calc(100vw - 28px));
  max-height: 86dvh;
  overflow: auto;
  transform: translate(-50%, -50%);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.25);
}

.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 14px 6px 22px; }
.sheet-head h2 { margin: 0; font-family: var(--round); font-weight: 900; font-size: 20px; }
.close { width: 40px; height: 40px; border-radius: 12px; font-size: 24px; }
.sheet-body { padding: 4px 22px 24px; }
.row { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row label, .row h3 { margin: 0; font-family: var(--round); font-weight: 900; font-size: 16px; }
.row small, .note { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.inline { display: flex; gap: 8px; }

input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--bg);
  font-size: 16px;
  font-weight: 700;
  outline: none;
}

input:focus { border-color: var(--c-blue); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 12px;
  background: var(--surface-2);
  font-family: var(--round);
  font-weight: 900;
  font-size: 15px;
  white-space: nowrap;
}

.button.primary { background: var(--accent); color: #fff; }
.button.wide { width: 100%; }

.code { margin: 4px 0; font-family: var(--round); font-weight: 900; font-size: 36px; letter-spacing: 0.2em; text-align: center; user-select: all; }
.error { margin: 0; color: var(--danger); font-size: 13px; font-weight: 700; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  font-weight: 700;
  transform: translate(-50%, 30px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s var(--ease-spring), opacity 0.25s ease;
}

.toast.on { transform: translate(-50%, 0); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
