/* The three themes are Compass's palettes (compass_app/lib/services/theme_service.dart). */
/* Glass is the default (:root) and comes first: a theme chosen later in this file must win at equal specificity. */
:root, [data-theme="glass"] { color-scheme: light; --bg1: #eaf4fb; --bg2: #bfd8ea; --bg3: #8fb4d0; --bg4: #6e97b8; --card: rgba(255, 255, 255, .62); --text: #0f2434; --muted: #2e4658; --line: rgba(255, 255, 255, .94); --accent: #1f6fa8; --accent2: #e8574a; --glow1: #ffffff; --glow2: #3b7fe0; --glow3: #e8574a; --logo-sq: var(--accent); --logo-l: var(--accent2); --logo-dark: #0f2434; --logo-light: #eaf4fb; }
[data-theme="classic"] { color-scheme: dark; --bg1: #0b1120; --bg2: #131e2e; --bg3: #1a2840; --bg4: #0b1120; --card: rgba(26, 40, 64, .78); --text: #e8f0fe; --muted: #9db0c6; --line: #243552; --accent: #4fc3f7; --accent2: #7c4dff; --glow1: #4fc3f7; --glow2: #7c4dff; --glow3: #0277bd; --logo-sq: var(--accent); --logo-l: var(--accent2); --logo-dark: #0b1120; --logo-light: #e8f0fe; }
[data-theme="metallic"] { color-scheme: dark; --bg1: #15120c; --bg2: #060606; --bg3: #0e0b07; --bg4: #040404; --card: rgba(28, 25, 18, .85); --text: #fff6df; --muted: #bfae86; --line: #6b5522; --accent: #f2c75c; --accent2: #ffe9a6; --glow1: #f2c75c; --glow2: #b8902e; --glow3: #a8731a; --logo-sq: var(--accent); --logo-l: var(--accent2); --logo-dark: #060606; --logo-light: #fff6df; }

* { box-sizing: border-box; }
html { background: var(--bg2); }
body { position: relative; margin: 0; min-height: 100vh; overflow-x: hidden; color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: linear-gradient(135deg, var(--bg1), var(--bg2) 42%, var(--bg3) 78%, var(--bg4)); background-attachment: fixed; }
body::before, body::after, .glow { content: ""; position: fixed; z-index: 0; border-radius: 50%; filter: blur(70px); opacity: .45; pointer-events: none; }
body::before { top: -18vmax; left: -12vmax; width: 55vmax; height: 55vmax; background: var(--glow1); animation: drift1 19s ease-in-out infinite alternate; }
body::after { right: -16vmax; bottom: -20vmax; width: 60vmax; height: 60vmax; background: var(--glow2); animation: drift2 23s ease-in-out infinite alternate; }
.glow { top: 35%; left: 40%; width: 34vmax; height: 34vmax; background: var(--glow3); opacity: .3; animation: drift3 17s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(24vw, 18vh) scale(1.2); } }
@keyframes drift2 { to { transform: translate(-26vw, -16vh) scale(.85); } }
@keyframes drift3 { to { transform: translate(-22vw, 20vh) scale(1.3); } }

main { position: relative; z-index: 1; max-width: 960px; margin: 0 auto; padding: 56px 16px; }
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 28px; }
h1 { margin: 0; font-size: 36px; font-weight: 800; letter-spacing: -0.01em; }
/* the lyu.si mark: classes, not inline styles (brand/README.md) */
.lm-f-sq { fill: var(--logo-sq); } .lm-f-l { fill: var(--logo-l); } .lm-f-dark { fill: var(--logo-dark); } .lm-f-light { fill: var(--logo-light); }
.lm-s-sq { stroke: var(--logo-sq); } .lm-s-dark { stroke: var(--logo-dark); } .lm-s-light { stroke: var(--logo-light); }
.mark { width: 48px; height: 48px; margin-right: 12px; vertical-align: -10px; border-radius: 9px; }
.name { background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent)); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 6s linear infinite; }
@keyframes shine { to { background-position: -200% center; } }
.beta { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #b7791f; color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .04em; vertical-align: middle; }

.settings { position: relative; }
.settings summary { padding: 7px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: 14px; font-weight: 600; cursor: pointer; list-style: none; }
.settings summary::-webkit-details-marker { display: none; }
.settings summary:focus-visible, .settings select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.panel { position: absolute; right: 0; z-index: 2; width: min(280px, calc(100vw - 32px)); margin-top: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg2); box-shadow: 0 12px 34px rgba(0, 0, 0, .35); }
.panel label { display: block; margin-bottom: 12px; font-size: 14px; font-weight: 600; }
.panel label:last-child { margin-bottom: 0; }
.panel select { display: block; width: 100%; margin-top: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg1); color: var(--text); font: inherit; font-weight: 400; }
.panel select:disabled { opacity: .55; }

#tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tile { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); animation: rise .55s cubic-bezier(.2, .8, .3, 1) both; transition: transform .25s, box-shadow .25s, border-color .25s; }
.tile:nth-child(2) { animation-delay: .09s; }
.tile:nth-child(3) { animation-delay: .18s; }
.tile:nth-child(n+4) { animation-delay: .27s; }
.tile:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 14px 34px color-mix(in srgb, var(--accent) 32%, transparent); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
.tile.is-default { border-color: var(--accent); }
.tile-open { flex: 1; display: block; padding: 20px; color: inherit; text-decoration: none; }
.tile-open:focus-visible, .tile-default:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tile-badge { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; color: #fff; font-size: 22px; font-weight: 700; box-shadow: 0 6px 16px rgba(0, 0, 0, .28); transition: transform .3s; }
.tile:hover .tile-badge { transform: rotate(-6deg) scale(1.1); }
.tile h2 { margin: 12px 0 4px; font-size: 18px; }
.tile p { margin: 0; color: var(--muted); font-size: 14px; }
.tile-signin { display: inline-block; margin-top: 10px; padding: 2px 10px; border: 1px solid var(--accent); border-radius: 999px; color: var(--accent); font-size: 12px; font-weight: 700; }
.tile-flag { position: absolute; top: 20px; right: 20px; color: var(--accent); font-size: 13px; font-weight: 600; }
.tile-default { border: 0; border-top: 1px solid var(--line); background: none; color: var(--accent); font: inherit; font-size: 14px; padding: 12px; cursor: pointer; }
.tile-default:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
#note { margin: 20px 0 0; color: var(--muted); font-size: 14px; }
.report { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.report a { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.account { display: flex; align-items: center; gap: 10px; margin-left: auto; font-size: 14px; }
.account-name { color: var(--muted); max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-link { padding: 7px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); font-weight: 600; text-decoration: none; }
.account-link:hover, .account-link:focus-visible { border-color: var(--accent); outline: none; }
.signin-hint { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.signin-hint:empty { display: none; }
.opening { margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--accent); border-radius: 12px; background: var(--card); font-size: 14px; }
.opening a { color: var(--accent); font-weight: 600; }
.opening button { margin-left: 8px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: none; color: var(--text); font: inherit; cursor: pointer; }
.splash-back { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .55); }
.splash-box { width: min(480px, 100%); max-height: 85vh; overflow: auto; padding: 22px 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.splash-box h2 { margin: 0 0 10px; font-size: 20px; }
.splash-text { margin: 0 0 18px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.splash-ok { padding: 8px 22px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }

.ad { margin: 28px 0 0; }
.ad h2 { margin: 0 0 10px; font-size: 18px; }
.ad video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: 16px; background: var(--bg2); box-shadow: 0 14px 34px rgba(0, 0, 0, .22); }
