/* Secret Mermaids: a beach at dusk. Deep sea blues, wet sand and a coral sun. */

:root {
    --sea: #0b3b52;
    --sea-deep: #072536;
    --sea-edge: #04141e;
    --panel: rgba(3, 20, 30, 0.62);
    --panel-line: rgba(242, 214, 160, 0.26);
    --sand: #f2d6a0;
    --sand-strong: #ffe7b8;
    --coral: #ff8a6b;
    --foam: #9fe3e0;
    --water: #2f8fd8;
    --ink: #f3f1ea;
    --muted: #b6c9cf;
    --danger-bg: #5a1a24;
    --card-w: clamp(52px, 9.5vw, 88px);
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

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

body {
    min-height: 100vh;
    color: var(--ink);
    font-family: var(--sans);
    line-height: 1.5;
    background:
        radial-gradient(ellipse at 80% -10%, rgba(255, 138, 107, 0.22), transparent 55%),
        radial-gradient(ellipse at 50% 120%, var(--sea-edge), transparent 70%),
        linear-gradient(180deg, var(--sea), var(--sea-deep));
    background-color: var(--sea-deep);
    background-attachment: fixed;
}

a { color: var(--sand); text-underline-offset: 3px; }
a:hover { color: var(--sand-strong); }

:focus-visible { outline: 3px solid var(--sand-strong); outline-offset: 2px; }

[hidden] { display: none !important; }

/* --- Top bar -------------------------------------------------------------- */

.bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    padding-top: max(10px, env(safe-area-inset-top));
    border-bottom: 1px solid var(--panel-line);
    background: rgba(2, 14, 22, 0.55);
    font-size: 15px;
}
.bar .back { color: var(--muted); text-decoration: none; white-space: nowrap; flex: 1; }
.bar .back:hover { color: var(--ink); }
.bar .title {
    font-family: var(--serif);
    font-size: 20px;
    letter-spacing: 0.06em;
    color: var(--sand);
    text-align: center;
    margin: 0;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bar .who { color: var(--muted); white-space: nowrap; text-align: right; flex: 1; overflow: hidden; text-overflow: ellipsis; }
.bar .who strong { color: var(--ink); font-weight: 600; }

@media (max-width: 520px) {
    .bar .back .long { display: none; }
}

/* --- Buttons -------------------------------------------------------------- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: inherit;
    font-weight: 700;
    font-size: 16px;
    padding: 11px 20px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}
.button:active:not([disabled]) { transform: translateY(1px); }
.button[disabled] { opacity: 0.45; cursor: not-allowed; }

.button.primary { background: var(--sand); color: #2a1b06; box-shadow: 0 2px 0 #a8875a; }
.button.primary:hover:not([disabled]) { background: var(--sand-strong); color: #2a1b06; }

.button.secondary { background: rgba(0, 0, 0, 0.18); color: var(--ink); border-color: var(--panel-line); }
.button.secondary:hover:not([disabled]) { border-color: var(--sand); color: var(--sand-strong); }

.button.small { font-size: 14px; padding: 7px 14px; }

/* --- Panels and messages -------------------------------------------------- */

.panel {
    background: var(--panel);
    border: 1px solid var(--panel-line);
    border-radius: 10px;
    padding: 20px;
}

.center-panel { max-width: 460px; margin: 48px auto; text-align: center; }
.center-panel h2 { font-family: var(--serif); font-size: 26px; margin: 0 0 8px; }
.center-panel p { color: var(--muted); margin: 0 0 20px; }

.row { display: flex; gap: 8px; flex-wrap: wrap; }

.toast {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translate(-50%, 20px);
    max-width: min(520px, calc(100vw - 32px));
    padding: 12px 18px;
    border-radius: 6px;
    background: var(--danger-bg);
    color: #fff;
    border: 1px solid rgba(255, 180, 168, 0.45);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.info { background: #123a4c; border-color: var(--panel-line); }

/* How to play, on both pages. */
details.rules { margin-top: 32px; }
details.rules summary {
    cursor: pointer; font-family: var(--serif); font-size: 22px; font-weight: 600;
    color: var(--sand); padding: 6px 0;
}
details.rules h3 { font-size: 16px; margin: 18px 0 6px; }
details.rules p, details.rules li { color: var(--muted); }
details.rules table { border-collapse: collapse; font-size: 15px; }
details.rules th, details.rules td { text-align: left; padding: 4px 12px 4px 0; border-bottom: 1px solid var(--panel-line); color: var(--muted); }

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

/* Buy me a coffee: the same badge on every game (see ADDING_A_GAME.md in mrkyle7/cheetahmoongames). */
.bmc {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: #ffdd00; color: #0d0c22;
  font: 600 14px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  text-decoration: none; white-space: nowrap;
}
.bmc:hover { background: #ffe74d; }
.bmc:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.bmc svg { width: 18px; height: 18px; flex: none; }
.bmc-row { margin: 24px 0 0; text-align: center; }
