*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
    margin: 0;
    background: var(--rb-bg);
    color: var(--rb-text);
    font-family: var(--rb-font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color .25s ease, color .25s ease;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--rb-focus-ring); outline-offset: 3px; }
::selection { color: #fff; background: #6654df; }

.skip-link { position: fixed; z-index: 1000; top: 12px; left: 12px; padding: 10px 16px; border-radius: var(--rb-radius-sm); background: var(--rb-text); color: var(--rb-surface); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border-radius: 13px; font-weight: 700; letter-spacing: -.015em; transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn[disabled] { cursor: not-allowed; opacity: .58; transform: none; box-shadow: none; }
.btn-primary { border: 1px solid var(--rb-primary); background: var(--rb-primary); color: #fff; box-shadow: 0 8px 18px rgba(67, 56, 202, .18); }
:root[data-theme="dark"] .btn-primary { color: #1a1730; }
:root[data-theme="dark"] .btn-primary:hover, :root[data-theme="dark"] .btn-primary:focus { color: #17152b; }
.btn-primary:hover, .btn-primary:focus { border-color: var(--rb-primary-strong); background: var(--rb-primary-strong); color: #fff; box-shadow: 0 10px 24px rgba(67, 56, 202, .24); }
.btn-primary--large { min-height: 54px; padding: 0 23px; font-size: 15px; }
.btn-outline-primary { min-height: 48px; padding: 0 18px; border: 1px solid var(--rb-border-strong); background: var(--rb-surface); color: var(--rb-primary); }
.btn-outline-primary:hover { border-color: var(--rb-primary); background: var(--rb-surface-violet); color: var(--rb-primary-strong); }

/* Shared form controls keep public and admin forms readable in both themes. */
.form-control, .form-select {
    min-height: 46px;
    border-color: var(--rb-border-strong);
    border-radius: 11px;
    background-color: var(--rb-surface);
    color: var(--rb-text);
}
.form-control::placeholder { color: var(--rb-text-subtle); }
.form-control:focus, .form-select:focus {
    border-color: var(--rb-violet);
    background-color: var(--rb-surface);
    color: var(--rb-text);
    box-shadow: 0 0 0 3px var(--rb-focus);
}
:root[data-theme="dark"] .form-control, :root[data-theme="dark"] .form-select {
    border-color: var(--rb-border-strong);
    background-color: var(--rb-surface-soft);
    color: var(--rb-text);
}
:root[data-theme="dark"] .form-select option { background: var(--rb-surface); color: var(--rb-text); }
.form-label { color: var(--rb-text); font-weight: 650; }
.form-text { color: var(--rb-text-muted) !important; } /* Phase 10: subtle was 3.19:1 */

.game-card { position: relative; display: flex; min-height: 239px; height: 100%; flex-direction: column; align-items: flex-start; padding: 22px 22px 20px; overflow: hidden; border: 1px solid var(--rb-border); border-radius: var(--rb-radius-md); background: var(--rb-surface); box-shadow: var(--rb-shadow-sm); transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, background-color .22s ease; }
.game-card::after { position: absolute; right: -42px; bottom: -55px; width: 120px; height: 120px; border-radius: 50%; background: var(--card-glow, rgba(124, 92, 246, .07)); content: ""; transition: transform .25s ease; }
.game-card:hover { z-index: 1; transform: translateY(-5px); border-color: var(--rb-border-strong); box-shadow: var(--rb-shadow-card); }
.game-card:focus-within { border-color: var(--rb-violet); box-shadow: 0 0 0 3px var(--rb-focus), var(--rb-shadow-card); }
.game-card:hover::after { transform: scale(1.35); }
.game-card__topline { display: flex; width: 100%; align-items: center; justify-content: space-between; }
.game-card__icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 15px; font-size: 21px; font-weight: 800; letter-spacing: -.07em; }
.game-card__icon svg, .featured-link__icon svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.game-card__icon--reaction svg { fill: currentColor; stroke: none; }
.game-card__index { color: var(--rb-text-subtle); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.game-card__icon--indigo { background: #ecebff; color: #4f46cc; --card-glow: rgba(91, 83, 225, .09); }
.game-card__icon--violet { background: #f1eaff; color: #874ce0; --card-glow: rgba(141, 83, 226, .1); }
.game-card__icon--mint { background: #e3f7ef; color: #21886b; --card-glow: rgba(38, 175, 132, .09); }
.game-card__icon--amber { background: #fff2d9; color: #aa7316; --card-glow: rgba(240, 171, 48, .1); }
.game-card__icon--rose { background: #ffebf0; color: #c24f78; --card-glow: rgba(221, 86, 130, .09); }
.game-card__icon--sky { background: #e5f4ff; color: #357bb4; --card-glow: rgba(71, 158, 220, .1); }
:root[data-theme="dark"] .game-card__icon--indigo { background: #302e53; color: #b0a9ff; }
:root[data-theme="dark"] .game-card__icon--violet { background: #3b2d55; color: #caabff; }
:root[data-theme="dark"] .game-card__icon--mint { background: #203c39; color: #8ee0bd; }
:root[data-theme="dark"] .game-card__icon--amber { background: #463926; color: #f4cd80; }
:root[data-theme="dark"] .game-card__icon--rose { background: #462c3a; color: #f1a0bd; }
:root[data-theme="dark"] .game-card__icon--sky { background: #263c50; color: #a2d8ff; }
.game-card__meta { margin-top: 17px; color: var(--rb-text-subtle); font-size: 11px; font-weight: 700; letter-spacing: .09em; line-height: 1.3; text-transform: uppercase; }
.game-card__title { display: flex; width: 100%; align-items: center; justify-content: space-between; margin: 16px 0 0; color: var(--rb-text); font-size: 17px; font-weight: 750; letter-spacing: -.035em; }
.game-card__arrow { color: var(--rb-primary); font-size: 17px; opacity: 0; transform: translate(-4px, 4px); transition: opacity .2s ease, transform .2s ease; }
.game-card:hover .game-card__arrow, .game-card:focus-visible .game-card__arrow { opacity: 1; transform: translate(0, 0); }
.game-card__description { max-width: 255px; margin: 6px 0 0; color: var(--rb-text-muted); font-size: 13px; line-height: 1.48; }
.game-card__link { z-index: 1; display: inline-flex; align-items: center; gap: 9px; margin-top: auto; padding-top: 18px; color: var(--rb-primary); font-size: 13px; font-weight: 800; }
.game-card__link span { transition: transform .18s ease; }
.game-card__link:hover span { transform: translate(2px, -2px); }

@media (prefers-reduced-motion: reduce) {
    .game-card, .game-card::after, .game-card__link span, .btn { transition: none; }
    .game-card:hover, .btn:hover { transform: none; }
}

.breadcrumbs { display: flex; flex-wrap: wrap; gap: 9px; margin: 0; padding: 0; color: var(--rb-text-subtle); font-size: 13px; list-style: none; }
.breadcrumbs__item:not(:last-child)::after { margin-left: 9px; color: var(--rb-text-subtle); content: "/"; }
.breadcrumbs__item a:hover { color: var(--rb-primary); }
.breadcrumbs__item.is-current { color: var(--rb-text); }

.alert { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--rb-border); border-radius: var(--rb-radius-sm); background: var(--rb-surface); color: var(--rb-text); }
.alert__symbol { display: grid; width: 22px; height: 22px; flex: 0 0 22px; place-items: center; border-radius: 50%; background: var(--rb-surface-violet); color: var(--rb-primary); font-size: 12px; font-weight: 800; }
.alert--success { border-color: #c9ead9; background: #f2fbf6; }
.alert--success .alert__symbol { background: #d9f2e5; color: #238559; }
.alert--warning { border-color: #f0dfb8; background: #fffaf0; }
.alert--warning .alert__symbol { background: #fff0c9; color: #9a6a12; }
.alert--error { border-color: #f0ccd4; background: #fff5f7; }
.alert--error .alert__symbol { background: #ffe2e8; color: #b63859; }
:root[data-theme="dark"] .alert--success { background: #1c3029; border-color: #2c5543; }
:root[data-theme="dark"] .alert--warning { background: #352e21; border-color: #5b4b2b; }
:root[data-theme="dark"] .alert--error { background: #38232b; border-color: #62404b; }

.contact-form-card { max-width: 720px; margin-inline: auto; padding: 22px; border: 1px solid var(--rb-border); border-radius: var(--rb-radius-md); background: var(--rb-surface); box-shadow: var(--rb-shadow-sm); }
@media (max-width: 575.98px) { .contact-form-card { padding: 18px; } }
