.up-document { margin: 0; background: #0a1113; }
.up-site {
  --up-ink: #f1f7f4;
  --up-muted: #aabbb9;
  --up-line: #304247;
  --up-surface: #131e22;
  --up-accent: #9af6c4;
  --up-on-accent: #102418;
  min-height: 100vh;
  color: var(--up-ink);
  background: radial-gradient(ellipse at 82% 0, #172b2e 0, transparent 42rem), #0a1113;
  font: 16px/1.55 system-ui, "Malgun Gothic", sans-serif;
  color-scheme: dark;
}
.up-site[data-play="sudoku"] { --up-accent: #d6c6ff; --up-on-accent: #251841; }
.up-site[data-play="gomoku"], .up-card-gomoku { --up-accent: #ffd399; --up-on-accent: #33200f; }
.up-site[data-play="chess"], .up-card-chess { --up-accent: #b7ddff; --up-on-accent: #102941; }
.up-site[data-play="minesweeper"], .up-card-minesweeper { --up-accent: #a0eaf6; --up-on-accent: #0a2532; }
.up-site[data-play="tictactoe"], .up-card-tictactoe { --up-accent: #ffb9d3; --up-on-accent: #3c1429; }
.up-site[data-play="solitaire"], .up-card-solitaire { --up-accent: #f8d38a; --up-on-accent: #382910; }
.up-site[data-play="memory-match"], .up-card-memory-match { --up-accent: #f9c79c; --up-on-accent: #31201c; }
.up-site *, .up-site *::before, .up-site *::after { box-sizing: border-box; }
.up-site a { color: var(--up-ink); }
.up-site button, .up-site select { font: inherit; }
.up-site :focus-visible { outline: 3px solid #ffd58b; outline-offset: 4px; }
.up-top, .up-main, .up-footer { width: min(calc(100% - 40px), 1120px); margin-inline: auto; }
.up-top, .up-footer { display: flex; justify-content: space-between; align-items: center; min-height: 70px; }
.up-top nav { display: flex; align-items: center; gap: 9px; }
.up-top nav a, .up-footer a {
  color: var(--up-muted); font-size: .875rem; text-decoration: none;
  padding: 6px 12px; border-radius: 8px;
}
.up-top nav a { border: 1px solid var(--up-line); }
.up-top nav a:hover, .up-footer a:hover { color: var(--up-ink); background: var(--up-surface); }
.up-top-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.up-top .ubis-service-language nav a { color: #18263d; }
.up-top .ubis-service-language nav a[aria-current] { color: #fff; }
.up-top .ubis-service-language nav a:hover { background: #eaf0f8; color: #18263d; }
.up-site .up-wordmark { color: var(--up-ink); font-size: 1.3rem; font-weight: 850; text-decoration: none; letter-spacing: -.04em; }
.up-wordmark span { color: #9af6c4; }
.up-footer { justify-content: center; border-top: 1px solid #243236; margin-top: 34px; }
.up-site .up-home-footer {
  margin-top: 34px;
  color: var(--up-muted);
  background: var(--up-surface);
  border-color: var(--up-line);
}
.up-site .up-footer-wordmark {
  gap: .22em; color: var(--up-ink); font-size: 1.3rem; font-weight: 850;
  letter-spacing: -.04em; text-decoration: none;
}
.up-footer-wordmark span { color: var(--up-accent); }
.up-site .up-home-footer nav a { color: var(--up-ink); }
.up-site .up-home-footer nav a:hover { color: var(--up-accent); }
.up-site .up-home-footer a:focus-visible { outline-color: var(--up-accent); }

.up-intro {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 310px;
  align-items: center;
  overflow: hidden;
  padding: 36px clamp(24px, 6vw, 72px);
  border: 1px solid #41675c;
  border-radius: 22px;
  background: radial-gradient(ellipse at 79% 37%, #285a49 0, transparent 65%),
    linear-gradient(115deg, #172a2e 7%, #132827 58%, #173a2d);
  box-shadow: 0 14px 48px #0003;
}
.up-intro::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: .28;
  background: repeating-linear-gradient(0deg, transparent 0 30px, #b3ffd02c 31px 32px),
    repeating-linear-gradient(90deg, transparent 0 30px, #b3ffd02c 31px 32px);
  mask-image: linear-gradient(to right, transparent 28%, #000);
}
.up-intro-copy { z-index: 1; position: relative; max-width: 47%; }
.up-access { display: inline-flex; align-items: center; gap: 8px; color: #b6e7c9; font-size: .85rem; font-weight: 650; }
.up-access::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #a0f9ba; box-shadow: 0 0 12px #a0f9ba; }
.up-intro h1 { margin: 7px 0 0; color: inherit; font-size: clamp(2.65rem, 7vw, 6rem); font-weight: 880; line-height: 1.03; letter-spacing: -.075em; }
.up-intro h1 span { color: #acffd1; }
.up-intro p { color: #d0dfdc; margin: 13px 0 0; font-size: clamp(.95rem, 1.8vw, 1.12rem); }
.up-hero-boards { position: absolute; inset: 0 0 0 44%; pointer-events: none; }
.up-hero-boards .up-card-art { position: absolute; inset: auto; width: 50%; aspect-ratio: 1; overflow: visible; background: none; }
.up-hero-boards .up-card-art::before { display: none; }
.up-hero-boards .up-art-sudoku { top: 5%; left: 0; }
.up-hero-boards .up-art-reversi { top: 12%; right: 7%; }
.up-hero-boards .up-art-board { width: min(96%, 230px); }
.up-hero-boards .up-art-sudoku .up-art-board { transform: perspective(650px) rotateX(30deg) rotateZ(-20deg); }
.up-hero-boards .up-art-reversi .up-art-board { transform: perspective(650px) rotateX(32deg) rotateZ(19deg); }
.up-library { margin-top: 28px; }
.up-library > h2 { margin: 0 0 12px; font-size: 1.26rem; font-weight: 750; letter-spacing: -.025em; }
.up-cards { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.up-card, .up-game, .up-rules { border: 1px solid var(--up-line); border-radius: 18px; background: var(--up-surface); }
.up-site .up-card { display: block; overflow: hidden; box-shadow: 0 13px 32px #0003; color: var(--up-ink); text-decoration: none; }
.up-card-sudoku { --up-accent: #d6c6ff; --up-on-accent: #251841; }
.up-card:is(:hover, :focus-visible) { border-color: var(--up-accent); }
.up-card-body { padding: 17px clamp(16px, 3vw, 25px) 22px; }
.up-card h3 { margin: 2px 0 0; color: inherit; font-size: 1.68rem; line-height: 1.18; letter-spacing: -.035em; }
.up-card p { margin: 8px 0 15px; color: var(--up-muted); font-size: .95rem; }
.up-card .up-card-type { margin: 0; color: var(--up-accent); font-weight: 675; font-size: .8rem; }
.up-card-art {
  position: relative; display: grid; place-items: center; overflow: hidden; min-height: 0;
  height: clamp(151px, 20vw, 221px);
  background: radial-gradient(ellipse, #8c76ba5c, transparent 69%), linear-gradient(128deg, #271943, #422d60);
}
.up-art-reversi { background: radial-gradient(ellipse, #80deb450, transparent 69%), linear-gradient(126deg, #102b2b, #1d4b3b); }
.up-art-gomoku { background: radial-gradient(ellipse, #d59f5670, transparent 70%), linear-gradient(126deg, #34261a, #684b27); }
.up-art-chess { background: radial-gradient(ellipse, #a7d4ff63, transparent 70%), linear-gradient(126deg, #182640, #2c4b6a); }
.up-card-art::before {
  content: ""; position: absolute; inset: -60%; opacity: .37; transform: rotate(-13deg);
  background: repeating-linear-gradient(90deg, transparent 0 33px, #d8f8ff29 34px 35px),
    repeating-linear-gradient(0deg, transparent 0 33px, #d8f8ff29 34px 35px);
  mask-image: radial-gradient(ellipse at center, #000, transparent 61%);
}
.up-art-board {
  position: relative; display: grid; gap: 3px; width: clamp(116px, 30%, 163px); aspect-ratio: 1;
  grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 7px; border-radius: 10px;
  transform: perspective(560px) rotateX(29deg) rotateZ(-16deg); transform-origin: center;
  border: 1px solid #e0cfff; background: #a688dc;
  box-shadow: 0 5px 0 #7552a8, 0 10px 0 #483477, 0 22px 36px #0b062293;
}
.up-art-reversi .up-art-board {
  grid-template-columns: repeat(4, minmax(0, 1fr)); transform: perspective(560px) rotateX(29deg) rotateZ(15deg);
  border-color: #8bdbb1; background: #6fa68f; box-shadow: 0 5px 0 #32674d, 0 10px 0 #183f31, 0 22px 36px #031813ba;
}
.up-art-gomoku .up-art-board, .up-art-chess .up-art-board { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.up-art-gomoku .up-art-board {
  border-color: #e5b773; background: #ca9751;
  box-shadow: 0 5px 0 #8c6033, 0 10px 0 #614225, 0 22px 36px #261407a0;
}
.up-art-gomoku .up-art-board > span { background: #e8b773; }
.up-art-chess .up-art-board {
  border-color: #c3e5ff; background: #6d91b2; gap: 0;
  box-shadow: 0 5px 0 #406380, 0 10px 0 #233d59, 0 22px 36px #081827b8;
}
.up-art-chess .up-art-board > span { border-radius: 0; color: #152b43; background: #d6e4ed; font-family: "Segoe UI Symbol", sans-serif; }
.up-art-chess .up-art-board > span:nth-child(8n+2), .up-art-chess .up-art-board > span:nth-child(8n+4),
.up-art-chess .up-art-board > span:nth-child(8n+5), .up-art-chess .up-art-board > span:nth-child(8n+7) { background: #87a7c1; }
.up-art-board > span { display: grid; place-items: center; min-width: 0; aspect-ratio: 1; border-radius: 4px; color: #36255a; background: #eee7ff; font-size: clamp(.8rem, 2.2vw, 1.55rem); font-weight: 850; line-height: 1; }
.up-art-sudoku .up-art-board > span:nth-child(5) { background: #ad8aef; color: #21153b; }
.up-art-reversi .up-art-board > span { background: #245b4c; }
.up-art-reversi .up-art-board > span:nth-child(2n) { background: #2e715b; }
.up-art-disc { width: 81%; aspect-ratio: 1; border-radius: 50%; box-shadow: 0 3px 0 #14292b, 0 6px 7px #00181475; }
.up-art-disc-light { background: linear-gradient(145deg, #fff, #bfdbd0); border: 1px solid #d9ede3; }
.up-art-disc-dark { background: linear-gradient(145deg, #405457, #102026); border: 1px solid #517069; }

.up-site .up-primary {
  display: inline-flex; align-items: center; gap: 14px; padding: 8px 13px; border: 1px solid transparent;
  border-radius: 9px; background: var(--up-accent); color: var(--up-on-accent); font-weight: 750; text-decoration: none;
}
.up-site .up-primary:hover { filter: brightness(1.095); }
.up-site[data-play]:not([data-play="home"]) .up-intro {
  min-height: 0; border-radius: 17px; padding: 18px 24px; margin-bottom: 14px;
}
.up-site[data-play]:not([data-play="home"]) .up-intro-copy { max-width: none; }
.up-site[data-play]:not([data-play="home"]) .up-intro h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin-top: 0; letter-spacing: -.045em; }
.up-site[data-play]:not([data-play="home"]) .up-intro p { margin-top: 7px; font-size: .96rem; }
.up-site[data-play="sudoku"] .up-intro {
  border-color: #5d4f86;
  background: radial-gradient(ellipse at right, #44305f, transparent 80%), #231c39;
}
.up-site[data-play="gomoku"] .up-intro {
  border-color: #8b6840; background: radial-gradient(ellipse at right, #704928, transparent 80%), #30251b;
}
.up-site[data-play="chess"] .up-intro {
  border-color: #536e8c; background: radial-gradient(ellipse at right, #375e7c, transparent 80%), #202b3d;
}
.up-site[data-play="solitaire"] .up-intro {
  border-color: #84724a; background: radial-gradient(ellipse at right, #416447, transparent 80%), #23382c;
}
.up-art-solitaire .up-art-board { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.up-art-solitaire .up-art-board > span { aspect-ratio: 3 / 4; background: #fff6e4; color: #22392f; }
.up-art-solitaire .up-art-board > span:nth-child(even) { color: #a02046; }
.up-art-memory-match .up-art-board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.up-art-memory-match .up-art-board > span { color: #fad1b1; background: #402d3d; border-color: #967789; }
.up-art-memory-match .up-art-board > span:nth-child(3n + 2) { color: #352841; background: #f1c19f; }
.up-site[data-play="solitaire"] .up-game-layout { grid-template-columns: minmax(0, 680px); }
.up-sol-table {
  padding: clamp(5px, 1.4vw, 12px); border: 1px solid #557b63; border-radius: 12px;
  background: radial-gradient(ellipse at 40% 0%, #316046, #163529 75%);
}
.up-sol-top, .up-sol-columns, .up-sol-foundation {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: clamp(2px, 1vw, 8px);
}
.up-sol-top { margin-bottom: clamp(12px, 3vw, 20px); }
.up-sol-waste-slot { grid-column: span 2; justify-items: start; }
.up-sol-waste-slot [data-role="waste"] {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: clamp(2px, 1vw, 8px);
  --up-sol-waste-step: clamp(15px, 4vw, 28px);
}
.up-sol-waste-slot [data-role="waste"] > .up-sol-card { grid-area: 1 / 1; }
.up-sol-waste-slot .up-sol-waste-peek { pointer-events: none; }
.up-sol-waste-slot .up-sol-waste-peek + .up-sol-card { margin-inline-start: var(--up-sol-waste-step); }
.up-sol-waste-slot .up-sol-waste-peek + .up-sol-waste-peek + .up-sol-card { margin-inline-start: calc(2 * var(--up-sol-waste-step)); }
.up-solitaire .up-control-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.up-sol-foundation { grid-column: 4 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.up-sol-slot { display: grid; align-content: end; gap: 3px; text-align: center; min-width: 0; }
.up-sol-slot > span { font-size: clamp(.59rem, 2.5vw, .82rem); font-weight: 650; line-height: 1.12; overflow-wrap: anywhere; }
.up-sol-pile { display: grid; align-content: start; min-width: 0; }
.up-sol-table .up-sol-card {
  box-sizing: border-box; display: flex; align-items: flex-start; justify-content: space-between; gap: 1px;
  width: 100%; min-width: 0; min-height: 44px; aspect-ratio: 3 / 4; position: relative;
  padding: clamp(1px, .6vw, 5px); border: 1px solid #e5d8b4; border-radius: 5px;
  color: #142a22; background: linear-gradient(150deg, #fffdf5, #f0e8d5); user-select: none;
}
.up-site .up-sol-card { font-size: clamp(.68rem, 3.25vw, 1.3rem); font-weight: 850; line-height: 1.08; }
.up-site .up-sol-waste-peek { flex-direction: column; justify-content: start; font-size: clamp(.5rem, 2.2vw, .88rem); gap: 0; }
.up-sol-card span { pointer-events: none; }
.up-sol-drag-preview { position: fixed; z-index: 10; display: grid; pointer-events: none; }
.up-sol-drag-preview .up-sol-card { grid-area: 1 / 1; align-self: start; }
.up-sol-card.up-sol-red { color: #a02039; }
.up-sol-card.up-sol-back {
  border-color: #96aa89; background: repeating-linear-gradient(45deg, #244a43 0 3px, #31584c 3px 6px);
  color: #fff6e4; align-items: center; justify-content: center; box-shadow: inset 0 0 0 2px #1e3c33;
}
.up-sol-card.up-sol-empty {
  border-style: dashed; border-color: #90aa96; color: #e0eadd;
  background: #102d2280; align-items: center; justify-content: center;
}
.up-sol-pile .up-sol-card {
  grid-area: 1 / 1; align-self: start;
  margin-block-start: calc(var(--up-sol-covered, 0) * clamp(9px, 2vw, 15px) + var(--up-sol-visible, 0) * clamp(24px, 6vw, 34px));
}
.up-sol-table .up-sol-card:focus-visible {
  outline: 2px solid var(--up-accent); outline-offset: -2px;
}
.up-sol-table .up-sol-card[aria-pressed="true"] {
  background: #ffedb8; color: #253525; box-shadow: inset 0 0 0 2px #9d6814;
}
.up-sol-table .up-sol-card.up-sol-red[aria-pressed="true"] { color: #a02039; }
.up-sol-table .up-sol-hint { outline: 2px solid #6ae7c6; outline-offset: -3px; }
@media (prefers-reduced-motion: no-preference) {
  .up-sol-recent { animation: up-sol-reveal .28s ease-out; }
  @keyframes up-sol-reveal { from { box-shadow: inset 0 0 0 3px #c69140; } }
}
.up-game-layout { display: grid; grid-template-columns: minmax(0, 580px); justify-content: center; gap: 16px; }
.up-game, .up-rules { padding: clamp(12px, 3vw, 22px); }
.up-rules h2 { margin: 0; font-size: 1.12rem; }
.up-rules p { margin: 8px 0 0; color: var(--up-muted); font-size: .95rem; line-height: 1.7; }
.up-game-guide { display: grid; gap: 8px; margin-top: 14px; }
.up-game-guide details { border: 1px solid var(--up-line); border-radius: 10px; background: #101a21; }
.up-game-guide summary {
  min-height: 44px; padding: 10px 12px; border-radius: 9px;
  color: var(--up-accent); cursor: pointer; font-weight: 700;
}
.up-game-guide summary:hover { background: #203544; }
.up-game-guide p { margin: 0 12px 8px; }
.up-game-guide dl { margin: 0; padding: 0 12px 8px; }
.up-game-guide dl > div { padding: 9px 0; border-top: 1px solid var(--up-line); }
.up-game-guide dt { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.up-game-guide dt span { color: var(--up-accent); font-size: 1.5rem; line-height: 1; }
.up-game-guide dd { margin: 4px 0 0; color: var(--up-muted); font-size: .95rem; line-height: 1.65; }
.up-controls { display: grid; row-gap: 10px; }
.up-settings, .up-control-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.up-settings label {
  display: grid; align-content: start; gap: 4px; min-width: 0; font-size: .87rem; color: var(--up-muted);
}
.up-settings label:only-child { grid-column: 1 / -1; }
.up-settings select { width: 100%; min-width: 0; }
.up-control-actions button { min-width: 0; justify-content: center; white-space: nowrap; }
.up-actions, .up-metrics { display: flex; gap: 8px; align-items: center; }
.up-actions { flex-wrap: wrap; }
.up-actions label { display: inline-flex; align-items: center; gap: 5px; color: var(--up-muted); }
.up-controls button, .up-controls select, .up-actions button, .up-digits button, .up-metrics button {
  min-height: 40px; border: 1px solid var(--up-line); border-radius: 8px; padding: 5px 9px;
  background: #202e34; color: var(--up-ink);
}
.up-site button:enabled { cursor: pointer; }
.up-site button:disabled { opacity: .53; }
.up-site button[aria-pressed="true"] { background: var(--up-accent); color: var(--up-on-accent); }
.up-site input[type="checkbox"] { accent-color: var(--up-accent); }
.up-metrics { margin: 12px 0; justify-content: space-between; color: var(--up-muted); font-size: .85rem; }
.up-metrics span { flex: 1; min-width: 0; padding: 6px 10px; background: #1d2a30; border: 1px solid #283a41; border-radius: 8px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.up-metrics button { flex-shrink: 0; white-space: nowrap; }
.up-metrics strong { color: var(--up-accent); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.up-board { width: 100%; border: 2px solid #77718c; border-radius: 7px; overflow: hidden; }
.up-row { display: grid; }
.up-sudoku .up-row { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.up-reversi .up-row, .up-chess .up-row { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.up-gomoku .up-row { grid-template-columns: repeat(15, minmax(0, 1fr)); }
.up-board .up-cell {
  display: grid; position: relative; place-items: center; width: 100%; aspect-ratio: 1;
  min-width: 0; border: 1px solid #474456; padding: 0; background: #211e2e; border-radius: 0;
  color: #dccaff; font-size: clamp(15px, 4vw, 24px); font-weight: 700;
}
.up-sudoku .up-row:nth-child(3n):not(:last-child) { border-bottom: 2px solid #8d7da4; }
.up-sudoku .up-row > :nth-child(3n):not(:last-child) { border-right: 2px solid #8d7da4; }
.up-board .up-given { color: #f6f0ff; background: #39304c; }
.up-board .up-error { color: #ffbec9; background: #5b263d; }
.up-board .up-selected { box-shadow: inset 0 0 0 3px #c1a5ff; z-index: 1; }
.up-board .up-cell:focus-visible { outline-offset: -4px; z-index: 2; }
.up-minesweeper, .up-art-minesweeper .up-art-board { border-color: #4d8597; }
.up-art-minesweeper .up-art-board > span { background: #204953; color: #b4f5ff; }
.up-art-tictactoe .up-art-board > span { background: #522d4d; color: #ffd0e6; }
[data-play="minesweeper"] .up-control-actions > :only-child,
[data-play="tictactoe"] .up-settings > :last-child { grid-column: 1 / -1; }
[data-play="minesweeper"] .up-board-scroll { overflow-x: auto; }
.up-mine-actions { margin-bottom: 10px; }
.up-mine-actions button { flex: 1; min-height: 44px; }
.up-mine-metrics span { display: grid; align-content: start; gap: 2px; overflow-wrap: anywhere; }
.up-site[data-play="memory-match"] .up-control-actions > :only-child { grid-column: 1 / -1; }
.up-memory-metrics span { display: grid; align-content: start; gap: 2px; }
.up-memory-preview {
  min-height: 39px; margin: 0 0 8px; padding: 6px 10px; border: 1px solid #725868; border-radius: 8px; text-align: center;
  color: var(--up-accent); background: #342738; font-weight: 700; font-variant-numeric: tabular-nums;
}
.up-memory-preview:empty { visibility: hidden; }
.up-board.up-memory-match {
  padding: clamp(4px, 1.7vw, 12px); border-color: #725868;
  background: radial-gradient(ellipse at 35% 0, #3a2b42 0%, #231f31 85%);
}
.up-memory-match, .up-memory-match .up-row { display: grid; gap: clamp(3px, 1vw, 8px); }
.up-memory-match .up-row { grid-template-columns: repeat(var(--up-board-size), minmax(0, 1fr)); }
.up-board.up-memory-match .up-cell {
  padding: 0; aspect-ratio: 4 / 5; border-radius: clamp(4px, 1.4vw, 10px); touch-action: manipulation;
  background: repeating-linear-gradient(135deg, #463447 0 5px, #4f3b4f 5px 10px); border-color: #8e7189;
  color: #e2b5a5; font-size: clamp(1rem, 5vw, 2.25rem); line-height: 1;
  box-shadow: inset 0 0 0 2px #342939, 0 2px 4px #130d1960;
}
.up-board.up-memory-match .up-cell[data-face="up"] { color: #332335; background: #fff0dc; border-color: #f2bd98; }
.up-board.up-memory-match .up-cell[data-face="matched"] { color: #162c24; background: #b2e3c1; border-color: #79bf98; }
.up-board.up-memory-match .up-cell:is([data-face="up"], [data-face="matched"]) { box-shadow: inset 0 0 0 2px #ffffff63; }
.up-board.up-memory-match .up-cell[data-face="down"][aria-disabled="false"]:hover { border-color: var(--up-accent); }
.up-board.up-memory-match .up-cell[aria-disabled="true"] { cursor: default; }
@media (prefers-reduced-motion: no-preference) {
  .up-memory-match .up-cell[data-face="up"] > span { animation: up-memory-flip .2s ease-out; }
  @keyframes up-memory-flip { from { transform: scale(.86); } }
}
.up-minesweeper { min-width: calc(var(--up-board-size, 8) * 24px + 4px); }
.up-minesweeper .up-row, .up-tictactoe .up-row { grid-template-columns: repeat(var(--up-board-size), minmax(0, 1fr)); }
.up-minesweeper .up-cell {
  touch-action: manipulation; line-height: 1; font-size: clamp(.82rem, 3vw, 1.3rem);
  border-color: #345763; background: linear-gradient(155deg, #274a59, #193440); color: #abedff;
}
.up-minesweeper .up-cell[data-tile="open"] { background: #132c36; color: #c4eaff; }
.up-minesweeper .up-cell[data-clue="2"] { color: #83efbe; }
.up-minesweeper .up-cell[data-clue="3"] { color: #ffa78f; }
.up-minesweeper .up-cell[data-clue="4"] { color: #ddbdff; }
.up-minesweeper .up-cell[data-tile="flag"] { color: #ffda84; background: #4b3920; }
.up-minesweeper .up-cell:is([data-tile="mine"], [data-tile="hit"]) { background: #50263d; color: #ffc7c9; }
.up-minesweeper .up-cell[data-tile="hit"] { background: #a73345; color: white; }
.up-tictactoe { border-color: #89607c; }
.up-tictactoe .up-cell {
  touch-action: manipulation; background: linear-gradient(155deg, #37273b, #251d30); border-color: #614458;
  font-size: clamp(1.15rem, calc(29vw / var(--up-board-size)), 4rem); font-weight: 850; line-height: 1;
}
.up-tictactoe .up-cell[data-mark="X"] { color: #ffb1d5; }
.up-tictactoe .up-cell[data-mark="O"] { color: #9cecf6; }
.up-tictactoe .up-tic-last { box-shadow: inset 0 0 0 2px #bf829d; }
.up-tictactoe .up-tic-winning { background: #4e395e; box-shadow: inset 0 0 0 2px currentColor; }
@media (prefers-reduced-motion: no-preference) {
  .up-minesweeper .up-mine-fresh { animation: up-mine-open .22s ease-out var(--up-reveal-delay) both; }
  .up-tictactoe .up-tic-winning { animation: up-tic-match .32s ease-out; }
}
@keyframes up-mine-open { from { opacity: .55; scale: .87; } to { opacity: 1; scale: 1; } }
@keyframes up-tic-match { 50% { filter: brightness(1.8); } }
.up-note-mark { position: relative; font: inherit; line-height: 1; color: #9ff2d2; }
.up-note-mark[data-multiple]::after {
  content: ""; position: absolute; inset: auto 15% -3px; border-bottom: 2px dotted currentColor;
}
.up-note-preview {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px;
  margin-top: 8px; padding: 4px 9px; border: 1px solid #36534e; border-radius: 7px;
  background: #1a2e2b; color: #b7ded0; font-size: .85rem;
}
.up-note-preview[hidden] { display: none; }
.up-note-preview strong {
  font-size: clamp(15px, 4vw, 24px); font-weight: 700; word-spacing: .14em; color: #aff7db;
}
.up-reversi { border-color: #54967e; background: #174735; }
.up-reversi .up-cell { background: linear-gradient(150deg, #296a55, #205442); border-color: #41806a; }
.up-reversi .up-legal::after { content: ""; width: 18%; aspect-ratio: 1; border-radius: 50%; background: #c6f8d2; box-shadow: 0 0 10px #b3ffc96e; }
.up-reversi .up-black::after, .up-reversi .up-white::after { content: ""; width: 73%; aspect-ratio: 1; border-radius: 50%; box-shadow: 0 3px 0 #0b3027, 0 5px 6px #0005; }
.up-reversi {
  --up-black-disc: linear-gradient(145deg, #37484d, #091215);
  --up-white-disc: linear-gradient(145deg, #fff, #bed6d0);
}
.up-reversi .up-black::after { background: var(--up-black-disc); border: 1px solid #4b6262; }
.up-reversi .up-white::after { background: var(--up-white-disc); border: 1px solid #e9f4ef; }
.up-reversi .up-black { --up-disc-back: var(--up-white-disc); --up-disc-front: var(--up-black-disc); }
.up-reversi .up-white { --up-disc-back: var(--up-black-disc); --up-disc-front: var(--up-white-disc); }
.up-reversi .up-last::after { outline: 2px solid #ffd58b; outline-offset: 2px; }
.up-gomoku {
  border-color: #a47742;
  background: repeating-linear-gradient(22deg, #d8a969 0 2px, #dfb576 3px 7px);
}
.up-gomoku .up-cell { border: 0; background: none; }
.up-gomoku .up-cell::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(#8b6239, #8b6239) center / 100% 1px no-repeat,
    linear-gradient(#8b6239, #8b6239) center / 1px 100% no-repeat;
}
.up-gomoku .up-row:first-child .up-cell::before { background-size: 100% 1px, 1px 50%; background-position: center, center bottom; }
.up-gomoku .up-row:last-child .up-cell::before { background-size: 100% 1px, 1px 50%; background-position: center, center top; }
.up-gomoku .up-row > :first-child .up-cell::before { background-size: 50% 1px, 1px 100%; background-position: right center, center; }
.up-gomoku .up-row > :last-child .up-cell::before { background-size: 50% 1px, 1px 100%; background-position: left center, center; }
.up-gomoku .up-black::after, .up-gomoku .up-white::after {
  content: ""; z-index: 1; width: 83%; aspect-ratio: 1; border-radius: 50%;
  border: 1px solid #594b3999; box-shadow: 0 2px 3px #48290777;
}
.up-gomoku .up-black::after { background: radial-gradient(circle at 36% 28%, #60564d, #251c17 70%); }
.up-gomoku .up-white::after { background: radial-gradient(circle at 36% 28%, #fffef1, #dcc8ae 74%); }
.up-gomoku .up-last::after { outline: 2px solid #a62c22; outline-offset: -2px; }
.up-gomoku .up-winning::after { outline: 2px solid #48efb0; outline-offset: -2px; box-shadow: 0 0 8px #116a57; }
.up-gomoku .up-cell[aria-disabled="false"]:hover { background: #fff4d545; }
.up-board-scroll.up-enlarged { width: 100%; overflow-x: auto; }
.up-enlarged .up-gomoku { min-width: 480px; }
.up-chess { border-color: #6f8ca8; }
.up-chess .up-cell {
  border: 0; background: #d7e6f0; color: #192c42; font-family: "Segoe UI Symbol", "DejaVu Sans", serif;
  font-size: clamp(18px, 6.8vw, 46px); line-height: 1;
}
.up-chess .up-dark-square { background: #82a5c1; }
.up-chess .up-white-piece { color: #fffdf4; text-shadow: 1px 1px 1px #273446, -1px -1px 1px #273446, 0 2px 2px #233d51; }
.up-chess .up-black-piece { color: #132236; text-shadow: 0 1px 1px #577894; }
.up-chess .up-last { box-shadow: inset 0 0 0 3px #456377; }
.up-chess .up-selected { box-shadow: inset 0 0 0 3px #173b64; background: #9cdcf0; }
.up-chess .up-in-check { background: #dc938f; }
.up-chess .up-chess-target::after {
  content: ""; position: absolute; width: 24%; aspect-ratio: 1; border-radius: 50%; background: #183c56af; pointer-events: none;
}
.up-chess .up-chess-capture::after { width: 85%; background: none; border: 3px solid #21577c; }
.up-claim[hidden], .up-claim [hidden] { display: none; }
.up-claim { margin-top: 10px; }
.up-move-log { margin-top: 12px; padding: 9px; border: 1px solid var(--up-line); border-radius: 8px; }
.up-move-log > div { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.up-move-log h2 { margin: 0; font-size: .91rem; }
.up-move-log ol { max-height: 7rem; overflow: auto; margin: 4px 0 0; padding-left: 2em; }
.up-move-log li { white-space: pre-wrap; font: .88rem/1.6 ui-monospace, monospace; }
.up-move-log button, .up-promotion button, .up-claim select {
  padding: 5px 8px; min-height: 34px; border: 1px solid var(--up-line); border-radius: 6px;
  background: #23333e; color: var(--up-ink);
}
.up-promotion { max-width: calc(100% - 28px); border: 1px solid #7596b3; border-radius: 12px; background: #172835; color: var(--up-ink); }
.up-promotion::backdrop { background: #091316a1; }
.up-promotion h2 { margin: 0 0 12px; font-size: 1.1rem; }
.up-promotion div { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.up-digits { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; margin: 10px 0; }
.up-digits button { min-width: 0; padding-inline: 0; font-weight: 750; color: var(--up-accent); }
.up-status { min-height: 1.55em; margin: 10px 0 0; color: var(--up-muted); font-size: .91rem; }
.up-turn-strip { min-height: 37px; margin-bottom: 8px; }
.up-turn {
  margin: 0; padding: 7px 10px; border-left: 3px solid var(--up-accent);
  border-radius: 5px; background: #192e2a; color: var(--up-accent); font-size: .9rem; font-weight: 700;
}
.up-turn[data-turn="computer"] { border-color: #b5c6d2; background: #202d37; color: #d8e5ee; }
.up-board-stage { position: relative; }
.up-board-overlay {
  position: absolute; z-index: 3; inset: 0; display: grid; place-items: center;
  border-radius: 7px; background: #0b171b88; padding: 12px; text-align: center;
}
.up-board-overlay[hidden], .up-board-overlay [hidden] { display: none; }
.up-overlay-panel {
  --up-result-accent: var(--up-accent);
  padding: clamp(12px, 4vw, 25px) clamp(17px, 4vw, 34px);
  border: 1px solid var(--up-result-accent); border-radius: 14px;
  background: linear-gradient(140deg, #23383e, #131e22 76%); box-shadow: 0 8px 30px #09161dbf;
}
.up-board-overlay[data-mode="loss"] .up-overlay-panel { --up-result-accent: #ffabb0; }
.up-board-overlay[data-mode="tie"] .up-overlay-panel { --up-result-accent: #d4e0e5; }
.up-overlay-panel strong { display: block; font-size: clamp(1.9rem, 7vw, 4rem); font-weight: 900; letter-spacing: -.055em; line-height: 1.08; color: var(--up-result-accent); }
.up-board-overlay[data-mode="loading"] strong { font-size: 1.1rem; letter-spacing: 0; }
.up-overlay-panel p { margin: 0 0 10px; color: #e1eeec; }
.up-overlay-panel strong:not([hidden]) + p:not([hidden]) { margin-top: 8px; }
.up-overlay-panel .up-primary { min-height: 44px; justify-content: center; background: var(--up-result-accent); }
.up-overlay-panel [data-action="board-start"] { font-size: 1.2rem; padding-inline: 24px; }
.up-history { margin-top: 12px; }
.up-history h2 { margin: 0 0 7px; color: var(--up-muted); font-size: .84rem; font-weight: 650; }
.up-history-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.up-history-grid > div {
  display: flex; flex-wrap: wrap; gap: 5px; align-items: baseline; justify-content: center;
  padding: 5px 4px; border: 1px solid color-mix(in srgb, var(--up-result) 42%, #26343a);
  border-radius: 8px; background: color-mix(in srgb, var(--up-result) 9%, #162126); color: var(--up-result);
  font-size: .86rem;
}
.up-history-grid strong { font-size: 1.2rem; line-height: 1.25; font-variant-numeric: tabular-nums; }
.up-history-grid [data-result="win"] { --up-result: #9af6c4; }
.up-history-grid [data-result="tie"] { --up-result: #d4e0e5; }
.up-history-grid [data-result="loss"] { --up-result: #ffabb0; }
@media (prefers-reduced-motion: no-preference) {
  .up-card { transition: border-color .18s ease; }
  .up-card .up-art-board { transition: scale .24s ease; }
  .up-card:hover .up-art-board { scale: 1.06; }
  .up-reversi .up-placed::after { animation: up-disc-place .24s ease-out both; }
  .up-reversi .up-flipped::after { animation: up-disc-flip .32s ease-in-out both; }
  .up-result-new { animation: up-result-highlight .9s ease-out; }
}
@keyframes up-disc-place {
  from { transform: translateY(-18%) scale(1.14); opacity: .25; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes up-disc-flip {
  0%, 49% { background: var(--up-disc-back); }
  51%, 100% { background: var(--up-disc-front); }
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(.08); }
}
@keyframes up-result-highlight {
  from { border-color: var(--up-result); box-shadow: 0 0 14px color-mix(in srgb, var(--up-result) 38%, transparent); }
  to { box-shadow: none; }
}
@media (max-width: 760px) {
  .up-top, .up-main, .up-footer { width: min(calc(100% - 26px), 600px); }
  .up-top { min-height: 57px; }
  .up-top { flex-wrap: wrap; gap: 6px; padding-block: 7px; }
  .up-top-actions { width: 100%; }
  .up-intro { min-height: 235px; padding: 22px 20px; }
  .up-hero-boards { inset-inline-start: 45%; }
  .up-hero-boards .up-card-art { width: 62%; }
  .up-hero-boards .up-art-reversi { top: 18%; right: -1%; }
  .up-intro-copy { max-width: 52%; }
  .up-intro h1 { font-size: clamp(2.15rem, 8vw, 4.1rem); }
}
@media (max-width: 470px) {
  .up-intro { min-height: 0; flex-direction: column; align-items: stretch; gap: 2px; padding: 19px 18px; }
  .up-intro-copy { max-width: 100%; }
  .up-hero-boards { position: relative; inset: auto; height: 112px; width: min(100%, 300px); justify-self: center; margin-inline: auto; }
  .up-hero-boards .up-card-art { top: auto; bottom: -4%; height: 112px; width: 46%; }
  .up-hero-boards .up-art-sudoku { left: 9%; }
  .up-hero-boards .up-art-reversi { right: 7%; }
  .up-hero-boards .up-art-board { width: 88px; padding: 4px; gap: 2px; }
  .up-cards { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .up-card-art { height: 155px; }
  .up-actions label { font-size: .86rem; }
}
