/* EpicUltra Tools: one look for every tool site. No fonts or files from other websites. */
:root {
  --bg: #060d20; --bg2: #0a1631; --card: #0d1b3a; --card2: #11234a; --line: rgba(120, 170, 255, 0.18);
  --text: #e7efff; --muted: #a9bddf; --dim: #7d93b8; --blue: #3987e5; --cyan: #1fb5e8; --green: #3ee08f;
  --red: #ff6b6b; --yellow: #ffd166; --radius: 14px;
  --grad: linear-gradient(135deg, #2f6bff, #1fb5e8);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: radial-gradient(1200px 600px at 80% -10%, #12306b 0%, transparent 60%), var(--bg);
  color: var(--text); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}
a { color: #8cc4ff; }
a:hover { color: #fff; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; font-weight: 750; margin-top: 0.2em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid #7cc4ff; outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 10; background: var(--card); padding: 8px 12px; border-radius: 8px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1040px; margin: 0 auto; padding: 16px 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.05rem; }
.brand .logo { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--grad); }
.brand b { color: #8cd6ff; }
.top nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.95rem; margin-left: 16px; }
.top nav a:hover { color: #fff; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 8px 20px 40px; }
.crumbs { font-size: 0.86rem; color: var(--dim); margin-bottom: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: #fff; text-decoration: underline; }
.title { display: flex; align-items: center; gap: 14px; }
.title .emoji { display: inline-grid; place-items: center; width: 56px; height: 56px; flex: none; border-radius: 16px; background: var(--card2); border: 1px solid var(--line); font-size: 30px; }
.lead { color: var(--muted); font-size: 1.07rem; max-width: 760px; margin-top: 4px; }

.card { background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35); }
.tool { margin: 22px 0 34px; min-height: 120px; }
.about, .faq, .related { margin: 0 0 30px; max-width: 820px; }
.about ol { padding-left: 1.2em; margin: 0 0 1em; }
.about li { margin-bottom: 4px; }
.about p, .faq p { color: #cfdcf3; }
.faq details { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 8px; background: rgba(255, 255, 255, 0.02); }
.faq summary { cursor: pointer; font-weight: 650; }
.faq details p { margin: 8px 0 0; }
.related { max-width: none; }
.grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid a { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); text-decoration: none; height: 100%; }
.grid a:hover { border-color: rgba(120, 190, 255, 0.5); background: var(--card2); }
.grid .e { font-size: 22px; width: 30px; text-align: center; flex: none; }
.grid b { display: block; font-weight: 650; }
.grid small { display: block; color: var(--dim); font-size: 0.8rem; line-height: 1.35; }

.foot { border-top: 1px solid var(--line); margin-top: 20px; padding: 22px 20px 90px; text-align: center; color: var(--dim); font-size: 0.86rem; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-bottom: 8px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: #fff; text-decoration: underline; }

/* ---------- the parts tools are made of ---------- */
.fields { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); margin-bottom: 16px; }
.field { display: grid; gap: 6px; align-content: start; font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.field.wide { grid-column: 1 / -1; }
.field small { font-weight: 500; color: var(--dim); }
.field .unit { display: flex; align-items: center; gap: 8px; }
.field .unit span { color: var(--dim); font-weight: 600; white-space: nowrap; }
input, select, textarea, button { font: inherit; }
input[type="text"], input[type="number"], input[type="date"], input[type="time"], input[type="datetime-local"], input[type="search"], select, textarea {
  width: 100%; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(140, 180, 255, 0.28); background: #071331; color: var(--text);
}
textarea { min-height: 150px; resize: vertical; line-height: 1.45; font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 0.92rem; }
textarea.plain { font-family: inherit; font-size: 1rem; }
input:focus, select:focus, textarea:focus { border-color: #6fb3ff; outline: none; box-shadow: 0 0 0 3px rgba(80, 150, 255, 0.25); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--blue); }
input[type="range"] { width: 100%; accent-color: var(--blue); }
input[type="color"] { width: 100%; height: 44px; padding: 2px; border-radius: 10px; border: 1px solid rgba(140, 180, 255, 0.28); background: #071331; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text); cursor: pointer; }

.btns { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 11px; border: 1px solid rgba(140, 180, 255, 0.3); background: rgba(255, 255, 255, 0.06); color: var(--text); font-weight: 650; cursor: pointer; text-decoration: none; }
.btn:hover { background: rgba(255, 255, 255, 0.12); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.big { min-height: 54px; font-size: 1.1rem; padding: 0 26px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 0.85rem; border-radius: 9px; }

.results { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.result { padding: 14px 16px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); min-width: 0; }
.result.big { grid-column: 1 / -1; background: rgba(57, 135, 229, 0.12); border-color: rgba(57, 135, 229, 0.45); }
.result .l { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--dim); font-weight: 700; }
.result .v { display: block; font-size: 1.3rem; font-weight: 750; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.result.big .v { font-size: 2rem; }
.result .s { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.result button { margin-top: 8px; }
.msg { padding: 10px 14px; border-radius: 10px; margin: 0 0 12px; font-size: 0.93rem; }
.msg.err { background: rgba(255, 107, 107, 0.12); border: 1px solid rgba(255, 107, 107, 0.4); color: #ffc9c9; }
.msg.info { background: rgba(57, 135, 229, 0.1); border: 1px solid rgba(57, 135, 229, 0.35); color: #cfe3ff; }
.msg:empty { display: none; }
.hint { color: var(--dim); font-size: 0.86rem; margin: 8px 0 0; }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.center { text-align: center; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.big-out { font-size: clamp(2rem, 7vw, 3.6rem); font-weight: 800; text-align: center; margin: 10px 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stage { position: relative; display: grid; place-items: center; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
canvas { max-width: 100%; display: block; border-radius: 12px; touch-action: none; }
.table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-weight: 650; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.list li { padding: 10px 14px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); font-size: 0.82rem; }
.out-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 0; font-weight: 650; color: var(--muted); font-size: 0.9rem; }
.ok { color: var(--green); }
.bad { color: var(--red); }
.warn { color: var(--yellow); }
[hidden] { display: none !important; }

/* the tools directory (tools.epicultra.net) */
.search { max-width: 520px; margin: 18px 0 26px; }
.search input { font-size: 1.05rem; padding: 13px 16px; }
.cat { margin: 0 0 32px; }
.cat h2 { display: flex; align-items: baseline; gap: 10px; }
.cat h2 small { color: var(--dim); font-weight: 600; font-size: 0.85rem; }

@media (max-width: 560px) {
  .top nav a:not(:last-child) { display: none; }
  .card { padding: 16px; }
  .title .emoji { width: 46px; height: 46px; font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .top, .foot, .related, .btns { display: none; } body { background: #fff; color: #000; } }

/* text compare */
.diffbox { border: 1px solid var(--line); border-radius: 12px; overflow: auto; max-height: 520px; font-size: 0.88rem; }
.diffbox .d { display: flex; gap: 10px; padding: 1px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.diffbox .d .op { width: 1ch; flex: none; color: var(--dim); }
.diffbox .add { background: rgba(62, 224, 143, 0.13); }
.diffbox .add .op { color: var(--green); }
.diffbox .del { background: rgba(255, 107, 107, 0.13); }
.diffbox .del .op { color: var(--red); }
.fancy { flex: 1; min-width: 0; font-size: 1.15rem; overflow-wrap: anywhere; }

/* colors, gradients, shadows */
.swatch { display: grid; place-items: center; height: 110px; border-radius: 14px; margin: 0 0 14px; font: 700 1.3rem ui-monospace, Consolas, monospace; border: 1px solid var(--line); }
.shades { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.shade { height: 54px; border-radius: 10px; border: 1px solid var(--line); font: 600 0.8rem ui-monospace, Consolas, monospace; cursor: pointer; }
.preview-box { height: 200px; border-radius: 16px; margin: 0 0 14px; border: 1px solid var(--line); }
.shadow-stage { display: grid; place-items: center; height: 240px; border-radius: 16px; background: #e9eef8; margin: 0 0 14px; }
.shadow-box { width: 150px; height: 110px; border-radius: 14px; background: #fff; }
.pw-out { font-size: clamp(1.1rem, 3.6vw, 1.8rem); word-break: break-all; padding: 14px; border-radius: 12px; background: #071331; border: 1px solid var(--line); }
mark { background: rgba(255, 209, 102, 0.35); color: inherit; border-radius: 3px; padding: 0 1px; }
.hl { white-space: pre-wrap; overflow-wrap: anywhere; padding: 12px 14px; border-radius: 12px; background: #071331; border: 1px solid var(--line); max-height: 360px; overflow: auto; }
.md { line-height: 1.6; padding: 4px 6px; overflow-wrap: anywhere; }
.md pre { background: #071331; border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow: auto; }
.md code { background: rgba(255, 255, 255, 0.08); padding: 1px 5px; border-radius: 5px; font-size: 0.9em; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: 0 0 1em; padding: 4px 14px; border-left: 3px solid var(--blue); color: var(--muted); }
.md table { border-collapse: collapse; margin: 0 0 1em; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 10px; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
.split { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.fav-big { width: 160px; height: 160px; background: repeating-conic-gradient(#1b2a4d 0% 25%, #12213f 0% 50%) 50% / 20px 20px; border-radius: 14px; }
.fav-s { border: 1px solid var(--line); image-rendering: pixelated; background: #12213f; }
.fav-s:nth-child(1) { width: 32px; height: 32px; } .fav-s:nth-child(2) { width: 48px; height: 48px; } .fav-s:nth-child(3) { width: 64px; height: 64px; }
.scroll-x { overflow-x: auto; max-width: 100%; }
.stage.scroll-x { display: block; }
.mc-view { padding: 16px 18px; border-radius: 10px; background: #3b3b3b; font: 600 1.3rem ui-monospace, Consolas, monospace; text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.55); margin: 0 0 14px; overflow-wrap: anywhere; min-height: 2.6em; }
.mc-sw { font: 700 1.1rem ui-monospace, Consolas, monospace; background: #3b3b3b; padding: 2px 8px; border-radius: 6px; }

/* click, key and reaction pads */
.pad { display: grid; place-content: center; gap: 6px; width: 100%; min-height: 260px; padding: 20px; border-radius: 16px; border: 2px dashed rgba(140, 180, 255, 0.35); background: rgba(57, 135, 229, 0.08); color: var(--text); text-align: center; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.pad:hover { background: rgba(57, 135, 229, 0.13); }
.pad-big { font-size: clamp(1.8rem, 6vw, 3rem); font-weight: 800; font-variant-numeric: tabular-nums; }
.pad-small { color: var(--muted); font-size: 0.95rem; }
.pad.react { border-style: solid; }
.pad.st-wait { background: #b8323f; border-color: #e0525f; }
.pad.st-go { background: #15803d; border-color: #3ee08f; }
.pad.st-early { background: #6b4a12; border-color: var(--yellow); }
.pad.st-wait .pad-small, .pad.st-go .pad-small, .pad.st-early .pad-small { color: #fff; }
.tries { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 14px 0; }
.tries li { padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.tries:empty { display: none; }

/* aim trainer */
.aim-status { font-weight: 650; color: var(--muted); margin: 0 0 10px; font-variant-numeric: tabular-nums; }
.aim-stage { position: relative; height: min(62vh, 520px); min-height: 300px; margin-bottom: 14px; border-radius: 16px; border: 1px solid var(--line); background: radial-gradient(circle at 50% 40%, #112552, #081430); overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: manipulation; cursor: crosshair; }
.aim-target { position: absolute; left: 0; top: 0; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 50%; cursor: crosshair; background: radial-gradient(circle, #fff 0 16%, #ff5d5d 17% 38%, #fff 39% 56%, #ff5d5d 57% 100%); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.25), 0 6px 18px rgba(0, 0, 0, 0.4); }
.aim-over { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 20px; text-align: center; background: rgba(6, 13, 32, 0.72); }
.aim-over p { max-width: 420px; margin: 0; }
.aim-miss { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 2px solid var(--red); pointer-events: none; animation: aim-miss 0.5s ease-out forwards; }
@keyframes aim-miss { to { opacity: 0; transform: scale(2); } }
@media (max-width: 560px) { .aim-target { width: 50px; height: 50px; } }

/* teams */
.teams { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); margin-top: 6px; }
.team { padding: 14px 16px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-top: 4px solid var(--blue); min-width: 0; }
.team h3 { font-size: 1.05rem; margin: 0 0 8px; }
.team h3 small { color: var(--dim); font-weight: 600; font-size: 0.8rem; }
.team ol { margin: 0; padding-left: 1.3em; overflow-wrap: anywhere; }
.team.c1 { border-top-color: var(--red); } .team.c2 { border-top-color: var(--green); } .team.c3 { border-top-color: var(--yellow); } .team.c4 { border-top-color: #b38cff; }
.team.c5 { border-top-color: #ff9f5a; } .team.c6 { border-top-color: var(--cyan); } .team.c7 { border-top-color: #ff7ac6; }

/* tier list */
.tl-title { font-size: 1.15rem; font-weight: 750; margin: 0 0 12px; }
.tl-board { display: grid; gap: 3px; border-radius: 12px; overflow: hidden; background: #050b1c; border: 1px solid var(--line); }
.tl-row { display: grid; grid-template-columns: 100px minmax(0, 1fr) auto; min-height: 86px; background: #121f3d; }
.tl-label { display: grid; place-items: center; padding: 4px; min-width: 0; }
.tl-label input[type="text"] { background: transparent; border: 0; color: #111; text-align: center; font-weight: 800; font-size: 1.4rem; padding: 2px; border-radius: 6px; }
.tl-label input[type="text"]:focus { box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.45); }
.tl-items { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; padding: 6px; min-height: 86px; min-width: 0; }
.tl-side { display: grid; align-content: center; gap: 3px; padding: 4px 6px; background: rgba(0, 0, 0, 0.18); }
.tl-mini { width: 30px; height: 24px; padding: 0; border-radius: 6px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); color: var(--muted); font-size: 0.7rem; cursor: pointer; }
.tl-mini:hover { color: #fff; background: rgba(255, 255, 255, 0.14); }
.tl-mini:disabled { opacity: 0.35; cursor: default; }
.tl-pool-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 16px 0 6px; font-weight: 650; color: var(--muted); font-size: 0.9rem; }
.tl-pool-head small { color: var(--dim); font-weight: 600; }
.tl-pool { border: 1px dashed rgba(140, 180, 255, 0.3); border-radius: 12px; background: rgba(255, 255, 255, 0.02); min-height: 96px; }
.tl-empty { color: var(--dim); font-size: 0.88rem; align-self: center; padding: 0 6px; }
.tl-item { display: grid; place-items: center; width: 74px; height: 74px; padding: 4px; border-radius: 8px; border: 2px solid transparent; background: #2a3a66; color: #fff; font: 650 0.78rem/1.15 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; text-align: center; overflow: hidden; overflow-wrap: anywhere; cursor: grab; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.tl-item.img { padding: 0; background: #0a1430; }
.tl-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; pointer-events: none; -webkit-user-drag: none; }
.tl-item.sel { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.35); touch-action: none; }
.tl-item.tl-dragging { opacity: 0.3; }
.tl-ghost { position: fixed; left: 0; top: 0; z-index: 2147483000; margin: 0; pointer-events: none; opacity: 0.92; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); }
.tl-items.tl-over { background: rgba(57, 135, 229, 0.2); }
body.tl-noselect { user-select: none; -webkit-user-select: none; cursor: grabbing; }
.tl-add { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 12px; }
.tl-add input[type="text"] { flex: 1 1 220px; width: auto; }
@media (max-width: 560px) {
  .tl-row { grid-template-columns: 62px minmax(0, 1fr) auto; }
  .tl-item { width: 58px; height: 58px; font-size: 0.68rem; }
  .tl-label input[type="text"] { font-size: 1.05rem; }
  .tl-mini { width: 26px; }
}

/* small games */
.game-hud { margin-bottom: 12px; }
.game-wrap { position: relative; width: fit-content; max-width: 100%; margin: 0 auto 14px; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.game-wrap:focus { outline: none; }
.game-wrap:focus-visible { outline: 2px solid #7cc4ff; outline-offset: 4px; border-radius: 14px; }
.game-canvas { display: block; border-radius: 14px; border: 1px solid var(--line); }
.game-over { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 20px; text-align: center; border-radius: 14px; background: rgba(6, 13, 32, 0.66); pointer-events: none; }
.game-over b { font-size: clamp(1.5rem, 5vw, 2.2rem); }
.game-over span { color: #d6e2f7; max-width: 320px; }
.game-over .btns { pointer-events: auto; justify-content: center; margin: 8px 0 0; }
.center-btns { justify-content: center; }
.dpad { display: grid; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(2, 48px); gap: 6px; justify-content: center; margin: 0 auto 10px; }
.dpad .btn { padding: 0; min-height: 0; font-size: 1.1rem; touch-action: manipulation; }
.dpad .dp-up { grid-column: 2; grid-row: 1; } .dpad .dp-left { grid-column: 1; grid-row: 2; } .dpad .dp-down { grid-column: 2; grid-row: 2; } .dpad .dp-right { grid-column: 3; grid-row: 2; }
.dpad.small-pad { grid-template-columns: repeat(3, 46px); grid-template-rows: repeat(2, 40px); }

/* 2048 */
.g2048-wrap { width: min(100%, 440px); }
.g2048 { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); gap: 10px; padding: 10px; border-radius: 14px; background: #0a1430; border: 1px solid var(--line); aspect-ratio: 1; }
.tile { display: grid; place-items: center; min-width: 0; border-radius: 10px; background: rgba(255, 255, 255, 0.05); font: 800 clamp(1.4rem, 7vw, 2.2rem)/1 system-ui, -apple-system, "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; color: #0b1a3d; }
.tile.t3d { font-size: clamp(1.15rem, 6vw, 1.8rem); }
.tile.t4d { font-size: clamp(0.95rem, 5vw, 1.45rem); }
.tile.t2 { background: #dbe7ff; } .tile.t4 { background: #c4d7ff; } .tile.t8 { background: #8fb5ff; }
.tile.t16 { background: #6c9cff; color: #fff; } .tile.t32 { background: #4f84f5; color: #fff; } .tile.t64 { background: #3b6be0; color: #fff; }
.tile.t128 { background: #2fb5e8; color: #fff; } .tile.t256 { background: #1fa0d6; color: #fff; } .tile.t512 { background: #19b394; color: #fff; }
.tile.t1024 { background: #2fcf7f; color: #fff; } .tile.t2048 { background: #ffd166; color: #3a2a00; } .tile.tbig { background: #ff7ac6; color: #fff; }
.tile.new { animation: tile-pop 0.16s ease-out; }
@keyframes tile-pop { from { transform: scale(0.4); } to { transform: scale(1); } }

/* minesweeper */
.mines-wrap { padding-bottom: 6px; }
.mines { --cell: 32px; display: grid; gap: 2px; width: max-content; margin: 0 auto; padding: 8px; border-radius: 12px; background: #0a1430; border: 1px solid var(--line); user-select: none; -webkit-user-select: none; }
.cell { width: var(--cell); height: var(--cell); padding: 0; border: 0; border-radius: 5px; background: #3a5385; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25), inset 0 2px 0 rgba(255, 255, 255, 0.12); color: #fff; font: 800 1rem/1 system-ui, -apple-system, "Segoe UI", sans-serif; cursor: pointer; touch-action: manipulation; -webkit-touch-callout: none; }
.cell:hover { background: #4a66a0; }
.cell.open { background: #16244a; box-shadow: none; cursor: default; }
.cell.mine { background: #5a2330; }
.cell.boom { background: #c0392b; }
.cell.n1 { color: #7cc4ff; } .cell.n2 { color: #6ee7a0; } .cell.n3 { color: #ff8080; } .cell.n4 { color: #b49cff; }
.cell.n5 { color: #ffb36b; } .cell.n6 { color: #5fe3e3; } .cell.n7 { color: #f0f0f0; } .cell.n8 { color: #9aa7c2; }
@media (max-width: 560px) { .mines { --cell: 30px; } }

/* tic-tac-toe */
.ttt { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 8px; width: min(100%, 360px); aspect-ratio: 1; margin: 0 auto 14px; }
.ttt-cell { min-width: 0; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); color: var(--text); font: 800 clamp(2.4rem, 12vw, 4rem)/1 system-ui, -apple-system, "Segoe UI", sans-serif; cursor: pointer; }
.ttt-cell:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); }
.ttt-cell:disabled { cursor: default; }
.ttt-cell.x { color: #7cc4ff; } .ttt-cell.o { color: #ffd166; }
.ttt-cell.win { background: rgba(62, 224, 143, 0.18); border-color: var(--green); }
.ttt-status { text-align: center; font-weight: 700; font-size: 1.15rem; margin: 6px 0 12px; }
.scores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 480px; margin: 0 auto; text-align: center; }

/* memory */
.mem { display: grid; gap: 10px; max-width: 560px; margin: 0 auto; }
.mem.mem-4 { grid-template-columns: repeat(4, 1fr); }
.mem.mem-6 { grid-template-columns: repeat(6, 1fr); max-width: 760px; }
.mem-card { aspect-ratio: 3 / 4; min-width: 0; padding: 0; border-radius: 12px; border: 1px solid var(--line); background: repeating-linear-gradient(45deg, #1d3a78 0 10px, #17306a 10px 20px); color: var(--text); font-size: clamp(1.6rem, 7vw, 2.6rem); cursor: pointer; }
.mem-card.up { background: #e7efff; }
.mem-card.done { background: #cdeedd; border-color: var(--green); cursor: default; }
@media (max-width: 560px) { .mem.mem-6 { grid-template-columns: repeat(4, 1fr); } }

/* playing cards */
.pstage { display: grid; place-items: center; margin: 6px 0 16px; }
.pcard { position: relative; display: grid; place-items: center; width: 150px; height: 210px; border-radius: 14px; background: #fff; color: #1b2340; box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4); font-family: Georgia, "Times New Roman", serif; }
.pcard.red { color: #c62839; }
.pc-r { position: absolute; left: 12px; top: 8px; font-size: 1.6rem; font-weight: 700; }
.pc-r2 { position: absolute; right: 12px; bottom: 8px; font-size: 1.1rem; transform: rotate(180deg); }
.pc-s { font-size: 4.2rem; line-height: 1; }
.pcard.small { width: 54px; height: 76px; border-radius: 8px; box-shadow: none; }
.pcard.small .pc-r { left: 6px; top: 4px; font-size: 0.85rem; }
.pcard.small .pc-s { font-size: 1.6rem; }
.pcard.small .pc-r2 { display: none; }
.pcard.pop { animation: card-pop 0.25s ease-out; }
@keyframes card-pop { from { transform: rotateY(80deg) scale(0.9); } to { transform: none; } }
.phist { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* just for fun */
.lead-in { font-size: 1.15rem; color: var(--muted); margin: 0; }
.count { font-size: 1.2rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.small-h { font-size: 1rem; margin: 18px 0 8px; color: var(--muted); }
.coin-stage { display: grid; place-items: center; margin: 6px 0 4px; perspective: 600px; }
.coin { display: grid; place-items: center; width: 150px; height: 150px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: radial-gradient(circle at 35% 30%, #fff3b0, #ffd166 40%, #c99a2e 100%); box-shadow: inset 0 0 0 8px rgba(160, 110, 20, 0.35), 0 12px 30px rgba(0, 0, 0, 0.45); color: #7a5410; }
.coin.tails { background: radial-gradient(circle at 35% 30%, #f1f5ff, #c3cfe6 45%, #8292b3 100%); box-shadow: inset 0 0 0 8px rgba(60, 80, 120, 0.35), 0 12px 30px rgba(0, 0, 0, 0.45); color: #33415f; }
.coin-face { font: 900 3.4rem/1 Georgia, "Times New Roman", serif; }
.coin.spin { animation: coin-spin 0.65s ease-out; }
@keyframes coin-spin { from { transform: rotateY(0) translateY(0); } 50% { transform: rotateY(900deg) translateY(-40px); } to { transform: rotateY(1800deg) translateY(0); } }
.coin-hist { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.coin-hist .pill { font-weight: 700; }
.fball { display: grid; place-items: center; width: 220px; height: 220px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; background: radial-gradient(circle at 35% 28%, #4b5a86, #141a33 55%, #05070f 100%); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55); }
.fb-window { display: grid; place-items: center; width: 118px; height: 118px; padding: 12px; border-radius: 50%; background: radial-gradient(circle, #2442a8, #0f1e5a); box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.6); }
.fb-text { color: #e6edff; font: 700 0.92rem/1.2 system-ui, -apple-system, "Segoe UI", sans-serif; text-align: center; }
.fball.yes .fb-window { background: radial-gradient(circle, #1f8a5a, #0d3f29); }
.fball.no .fb-window { background: radial-gradient(circle, #a33a3a, #4a1414); }
.fball.maybe .fb-window { background: radial-gradient(circle, #8a6a1f, #3f300d); }
.fball.shake { animation: fb-shake 0.7s ease-in-out; }
@keyframes fb-shake { 0%, 100% { transform: none; } 15% { transform: translate(-10px, 4px) rotate(-6deg); } 35% { transform: translate(10px, -4px) rotate(5deg); } 55% { transform: translate(-8px, 2px) rotate(-4deg); } 75% { transform: translate(6px, -2px) rotate(3deg); } }
.fb-said { font-size: 1.1rem; font-weight: 650; min-height: 1.6em; overflow-wrap: anywhere; }
.excuse { margin: 4px 0 16px; padding: 18px 20px; border-left: 4px solid var(--blue); border-radius: 12px; background: rgba(57, 135, 229, 0.1); font-size: clamp(1.1rem, 3vw, 1.35rem); font-weight: 600; min-height: 3.2em; }
.names { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.names li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.names .nm { flex: 1 1 140px; font-weight: 750; font-size: 1.1rem; overflow-wrap: anywhere; }
.idea { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.result.locked { border-color: var(--yellow); background: rgba(255, 209, 102, 0.08); }
.idea-text { margin: 16px 0 0; padding: 16px 18px; border-radius: 12px; background: rgba(57, 135, 229, 0.1); border-left: 4px solid var(--blue); font-size: 1.08rem; }
.uptime { font-size: clamp(1.8rem, 7vw, 3.2rem); }
.clocks { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); margin-bottom: 14px; }
.clock { position: relative; }
.clock-t { font-size: 1.7rem; }
.result.big .clock-t { font-size: 2.4rem; }
.clock-x { position: absolute; top: 6px; right: 6px; margin: 0 !important; min-height: 26px; padding: 0 8px; }
.clock-add select { width: auto; max-width: 220px; }
.moon-stage { display: grid; place-items: center; margin: 4px 0 14px; }
.moon-c { border-radius: 50%; }
.moon-next b { font-weight: 700; }

/* pixel art */
.px-colors { margin-bottom: 10px; }
.px-pal { display: flex; flex-wrap: wrap; gap: 4px; }
.px-sw { width: 26px; height: 26px; padding: 0; border-radius: 6px; border: 2px solid rgba(255, 255, 255, 0.25); cursor: pointer; }
.px-sw.on { border-color: #fff; box-shadow: 0 0 0 2px var(--blue); }
.px-now { display: inline-block; width: 42px; height: 42px; border-radius: 10px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.px-color { width: 56px !important; }
.px-wrap { display: grid; place-items: center; margin: 6px 0 12px; }
.px-canvas { border-radius: 4px; cursor: crosshair; touch-action: none; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); image-rendering: pixelated; }
.px-bar { margin-bottom: 10px; }
.px-bar select { width: auto; }
.px-bar input[type="range"] { width: 200px; }

/* soundboard */
.sb-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); margin-bottom: 16px; }
.sb-btn { position: relative; display: grid; justify-items: center; gap: 4px; padding: 16px 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--card2), var(--card)); color: var(--text); font-weight: 650; cursor: pointer; touch-action: manipulation; }
.sb-btn:hover { border-color: rgba(120, 190, 255, 0.5); }
.sb-btn:active, .sb-btn.hit { animation: sb-hit 0.25s ease-out; }
@keyframes sb-hit { 0% { transform: scale(0.94); background: rgba(57, 135, 229, 0.35); } 100% { transform: none; } }
.sb-e { font-size: 2rem; line-height: 1; }
.sb-btn kbd { position: absolute; top: 6px; right: 8px; font: 600 0.72rem ui-monospace, Consolas, monospace; color: var(--dim); }
