:root {
    color-scheme: dark;
    --bg: #11141f;
    --panel: #f2ecdd;
    --ink: #1b2233;
    --accent: #c1272d;
    --accent-blue: #1b2b5c;
    --selected: #c1272d;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    font-family: "Segoe UI", system-ui, sans-serif;
    display: flex;
    justify-content: center;
    padding: 24px 12px 60px;
}

.page {
    width: 100%;
    max-width: 1000px;
}

.banner {
    background: var(--bg);
    border: 3px solid var(--accent);
    border-radius: 10px 10px 0 0;
    padding: 18px 20px;
    text-align: center;
}

.banner h1 {
    margin: 0;
    color: #f2ecdd;
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.banner h1 span {
    color: var(--accent);
}

.banner p {
    margin: 6px 0 0;
    color: #b8bccb;
    font-size: 0.9rem;
}

.banner p.hint {
    font-size: 0.8rem;
    color: #7d8299;
}

.grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    background: var(--ink);
    border: 3px solid var(--ink);
    border-top: none;
}

.tile {
    position: relative;
    background: var(--panel);
    color: var(--ink);
    padding: 10px 8px;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease, transform 0.1s ease;
}

.tile:hover {
    background: #e8e0c8;
}

.tile.selected {
    background: #fbe3d4;
}

.tile .num {
    font-weight: 700;
    color: var(--accent-blue);
    font-size: 0.75rem;
}

.tile .icon {
    font-size: 1.6rem;
    line-height: 1.2;
    margin: 2px 0;
}

.tile .title {
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    color: var(--accent-blue);
    margin-bottom: 4px;
}

.tile .desc {
    font-size: 0.68rem;
    color: #3a3f4d;
    line-height: 1.25;
}

.tile .stamp {
    position: absolute;
    inset: 10%;
    border: 5px solid rgba(193, 39, 45, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(193, 39, 45, 0.8);
    font-weight: 900;
    font-size: 2.4rem;
    background: rgba(193, 39, 45, 0.16);
    mix-blend-mode: multiply;
    pointer-events: none;
    opacity: 0;
    transform: rotate(-12deg) scale(0.5);
    transition: opacity 0.15s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tile.selected .stamp {
    opacity: 1;
    transform: rotate(-12deg) scale(1);
}

.tile .tooltip {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    width: 260px;
    max-width: 70vw;
    background: var(--ink);
    color: var(--panel);
    text-align: left;
    text-transform: none;
    font-weight: 400;
    font-size: 0.72rem;
    line-height: 1.4;
    padding: 10px 12px;
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    z-index: 30;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.tile .tooltip::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: var(--ink);
}

.tile .tooltip strong {
    display: block;
    color: #ff8a8f;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.tile .tooltip .tooltip-list {
    margin: 0;
    padding-left: 16px;
}

.tile .tooltip .tooltip-list li {
    margin-bottom: 5px;
}

.tile .tooltip .tooltip-list li:last-child {
    margin-bottom: 0;
}

.tile .tooltip .tooltip-other:empty {
    display: none;
}

.tile .tooltip .tooltip-divider {
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px solid rgba(242, 236, 221, 0.2);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #9aa0b4;
    margin-bottom: 5px;
}

.tile:hover .tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

button {
    font-family: inherit;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
    padding: 12px 22px;
    border-radius: 6px;
    border: 2px solid var(--accent);
    cursor: pointer;
    transition: transform 0.1s ease, background 0.15s ease;
}

button:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: #a11f24;
}

.btn-secondary {
    background: transparent;
    color: var(--accent);
}

.btn-secondary:hover {
    background: rgba(193, 39, 45, 0.12);
}

.footer-note {
    text-align: center;
    color: #7d8299;
    font-size: 0.75rem;
    margin-top: 14px;
}
