:root {
  color-scheme: light dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

html[data-theme="light"] {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --text: #101114;
  --muted: #626875;
  --line: #d9dde5;
  --button: #101114;
  --button-text: #ffffff;
  --soft: #f0f2f5;
}

html[data-theme="dark"] {
  --bg: #070708;
  --panel: #111215;
  --text: #f5f6f8;
  --muted: #b1b6c1;
  --line: #272b33;
  --button: #ffffff;
  --button-text: #101114;
  --soft: #1b1d22;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.panel {
  width: min(100%, 440px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .16);
}

.app-panel {
  text-align: center;
}

.app-icon {
  width: 108px;
  height: 108px;
  border-radius: 24px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--soft);
  box-shadow: 0 18px 38px rgba(0, 0, 0, .18);
}

.app-icon.small {
  width: 72px;
  height: 72px;
  border-radius: 18px;
}

.eyebrow {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 9vw, 3.1rem);
  line-height: 1;
  font-weight: 800;
}

.support {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.store-actions {
  display: grid;
  gap: 12px;
  width: min(100%, 330px);
  margin: 16px auto 0;
}

.store-button {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--text);
  text-decoration: none;
  text-align: left;
}

.store-button.primary {
  border-color: var(--button);
  background: var(--button);
  color: var(--button-text);
}

.store-button span {
  font-size: 1.08rem;
  font-weight: 800;
}

.store-button small {
  color: currentColor;
  opacity: .72;
  font-size: .84rem;
  font-weight: 600;
}

.store-button.disabled {
  opacity: .54;
}

.store-button-download {
  min-height: 76px;
  justify-content: flex-start;
  gap: 16px;
  padding: 12px 18px;
  border-color: #050505;
  background: #050505;
  color: #fff;
  font-family: "Helvetica Neue", Arial, sans-serif;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .18);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.store-button-download:hover,
.store-button-download:focus {
  border-color: #2a2d34;
  box-shadow: 0 18px 38px rgba(0, 0, 0, .24);
  transform: translateY(-1px);
}

.store-mark-wrap {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
}

.store-mark-wrap-play {
  border-radius: 12px;
  background: #fff;
}

.store-mark-wrap-play .store-mark {
  width: 34px;
  height: 34px;
}

.store-mark {
  width: 46px;
  height: 46px;
  display: block;
}

.store-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.store-copy small {
  color: #fff;
  opacity: 1;
  font-size: .9rem;
  font-weight: 500;
  line-height: .95;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.store-copy strong {
  color: #fff;
  font-size: 1.88rem;
  font-weight: 500;
  line-height: .98;
  letter-spacing: 0;
  white-space: nowrap;
}

.store-button-android .store-copy {
  font-family: "Google Sans", "Product Sans", Roboto, Arial, sans-serif;
}

.store-button-android .store-copy small {
  font-size: .86rem;
  font-weight: 500;
  text-transform: uppercase;
}

.store-button-android .store-copy strong {
  font-size: 1.84rem;
  font-weight: 500;
}

.store-button-ios .store-copy {
  font-family: "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
}

.store-button-ios .store-copy small {
  font-size: 1rem;
  font-weight: 400;
  text-transform: none;
}

.store-button-ios .store-copy strong {
  font-size: 1.98rem;
  font-weight: 500;
}

html[lang="ja"] .store-copy small {
  font-size: .82rem;
  text-transform: none;
}

html[lang="ja"] .store-copy strong {
  font-size: 1.72rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.game-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.game-row {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  background: var(--soft);
}

.game-row span {
  font-weight: 800;
}

.game-row small {
  color: var(--muted);
  word-break: break-all;
}

.redirect-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 22px;
}

.redirect-panel {
  width: min(100%, 360px);
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
}

.redirect-panel h1 {
  font-size: 2rem;
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.login-form input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--soft);
  color: var(--text);
  font: inherit;
}

.error-text {
  margin: 16px 0 0;
  color: #d33b3b;
  font-weight: 700;
}

.admin-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 28px 20px 40px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.admin-header .eyebrow {
  margin-top: 0;
}

.logout {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  text-decoration: none;
  background: var(--panel);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat,
.admin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.stat {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.stat span,
.metric-row span,
.admin-game small,
.admin-numbers {
  color: var(--muted);
}

.stat strong {
  font-size: 2rem;
  line-height: 1;
}

.admin-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.admin-card {
  padding: 18px;
}

.admin-card h2 {
  margin: 0 0 14px;
  font-size: 1.1rem;
}

.metric-row,
.admin-game {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.metric-row:first-of-type,
.admin-game:first-child {
  border-top: 0;
}

.admin-list {
  display: grid;
}

.admin-game {
  color: var(--text);
}

.admin-game span:first-child {
  display: grid;
  gap: 4px;
}

.admin-game-main {
  color: var(--text);
  text-decoration: none;
}

.copy-link-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--soft);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.copy-link-button:hover,
.copy-link-button:focus {
  border-color: var(--text);
}

.admin-game small {
  word-break: break-all;
}

@media (max-width: 380px) {
  .panel {
    padding: 22px;
  }

  .store-button:not(.store-button-download) {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .store-button-download {
    gap: 12px;
    padding: 12px 14px;
  }

  .store-copy strong,
  .store-button-android .store-copy strong,
  .store-button-ios .store-copy strong {
    font-size: 1.58rem;
  }
}

@media (max-width: 820px) {
  .stats-grid,
  .admin-columns {
    grid-template-columns: 1fr;
  }

  .admin-header,
  .admin-game {
    align-items: flex-start;
    flex-direction: column;
  }
}
