:root {
    --bg: #070604;
    --ink: #11100d;
    --panel: rgba(20, 17, 13, .94);
    --panel-2: rgba(27, 22, 16, .92);
    --line: rgba(199, 151, 86, .24);
    --line-strong: rgba(218, 170, 101, .42);
    --text: #efe1c6;
    --muted: #bca78a;
    --gold: #c99a5b;
    --gold-2: #e1bd82;
    --danger: #d45b5b;
    --success: #8bcf85;
    --nri: #9a62ee;
    --wargame: #79c85b;
    --boardgame: #30bfe8;
    --mafia: #e34d4d;
    --shadow: 0 22px 70px rgba(0, 0, 0, .5);
    --radius: 6px;
    --font: Georgia, 'Times New Roman', serif;
    --ui: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: var(--font);
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 52% -12%, rgba(143, 101, 43, .16), transparent 38%),
        radial-gradient(circle at 100% 0%, rgba(95, 63, 30, .12), transparent 34%),
        linear-gradient(90deg, rgba(5, 4, 3, .72), rgba(7, 6, 4, .54) 48%, rgba(5, 5, 4, .78)),
        url("../images/bg_main_texture.png");
    background-size: auto, auto, auto, cover;
    background-position: center;
    background-attachment: fixed;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(0,0,0,.45), transparent 18%, transparent 82%, rgba(0,0,0,.32)),
        radial-gradient(circle at center, transparent 58%, rgba(0,0,0,.5));
    z-index: -1;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; color: #f2d9ad; }
h1 { font-size: 34px; line-height: 1.1; }
h2 { font-size: 25px; line-height: 1.1; }
h3 { font-size: 18px; line-height: 1.15; }

.app-shell {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    min-height: 100vh;
}
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 0 18px;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: #110b06;
    background-image:
        linear-gradient(180deg, rgba(12, 8, 5, .2), rgba(15, 9, 5, .38)),
        url("../images/sidebar_panel.png"),
        url("../images/bg_sidebar_texture.png");
    background-size: auto, 100% 100%, cover;
    background-position: center top;
    border-right: 1px solid rgba(211, 157, 91, .28);
    box-shadow: inset -24px 0 45px rgba(0,0,0,.28);
}
.brand {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 4px;
    padding: 0 16px 18px;
    text-align: center;
    color: #ead0a2;
    isolation: isolate;
}
.brand::after {
    content: "";
    position: absolute;
    left: calc(50% - 23px);
    top: 42px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    background:
        radial-gradient(circle, rgba(255, 245, 165, 1) 0 18%, rgba(255, 117, 23, .96) 34%, rgba(180, 21, 8, .65) 55%, transparent 72%);
    filter: blur(.2px) drop-shadow(0 0 8px rgba(255, 84, 13, .95)) drop-shadow(0 0 16px rgba(255, 158, 45, .72));
    transform: translate(-50%, -50%) scale(.72);
    z-index: 2;
}
.brand:hover::after,
.brand:focus-visible::after {
    animation: dragon-eye-burn 1.08s ease-in-out infinite alternate;
    opacity: 1;
}
.brand-logo {
    width: min(196px, 100%);
    height: auto;
    display: block;
    filter: drop-shadow(0 16px 24px rgba(0,0,0,.55));
}
.brand-subtitle {
    display: block;
    margin-top: -4px;
    color: #c7ad87;
    font-size: 14px;
    text-shadow: 0 2px 8px rgba(0,0,0,.75);
}

@keyframes dragon-eye-burn {
    0% {
        opacity: .62;
        transform: translate(-50%, -50%) scale(.74);
        box-shadow: 0 0 6px rgba(255, 71, 8, .7);
    }
    52% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.18);
        box-shadow: 0 0 18px rgba(255, 98, 12, .88), 0 0 30px rgba(245, 170, 52, .34);
    }
    100% {
        opacity: .84;
        transform: translate(-50%, -50%) scale(.95);
        box-shadow: 0 0 12px rgba(255, 143, 31, .78);
    }
}

.side-nav {
    display: grid;
    gap: 7px;
    margin-top: 2px;
    padding-left: 14px;
    padding-right: 14px;
    padding-bottom: 340px;
}
.side-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 52px;
    padding: 0 24px;
    color: #d7c1a0;
    font-size: 15px;
    text-transform: uppercase;
    border: 0;
    background-image: url("../images/sidebar_menu_item_default.png");
    background-size: 100% auto;
    background-position: center;
    background-repeat: no-repeat;
    transition: color .18s ease, filter .18s ease, transform .18s ease;
}
.side-nav a span {
    width: 24px;
    color: #d9b57b;
    text-align: center;
    font-size: 22px;
    line-height: 1;
}
.side-nav a:hover,
.side-nav a.active {
    color: #ffe2ad;
    filter: drop-shadow(0 0 10px rgba(216, 139, 48, .35));
}
.side-nav a:hover {
    background-image: url("../images/sidebar_menu_item_hover.png");
}
.side-nav a.active {
    background-image: url("../images/sidebar_menu_item_active.png");
}
.side-nav a.active::after {
    content: "";
    position: absolute;
    right: -1px;
    top: 50%;
    width: 11px;
    height: 11px;
    border-top: 1px solid rgba(216,164,91,.46);
    border-right: 1px solid rgba(216,164,91,.46);
    background: rgba(19, 12, 6, .88);
    transform: translateY(-50%) rotate(45deg);
}

.mascot-card {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 18px;
    min-height: 340px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border-radius: var(--radius);
    overflow: hidden;
    border: 0;
    background: radial-gradient(circle at 50% 78%, rgba(177, 99, 42, .22), transparent 58%);
}
.mascot-bubble {
    position: relative;
    z-index: 2;
    margin: 12px;
    padding: 12px 13px;
    border-radius: 5px;
    background: #e8d4aa;
    color: #3b2817;
    font-size: 14px;
    line-height: 1.35;
    text-align: center;
    box-shadow: 0 12px 24px rgba(0,0,0,.28);
}
.mascot-bubble::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -9px;
    width: 18px;
    height: 18px;
    background: inherit;
    transform: translateX(-50%) rotate(45deg);
}
.mascot-img {
    width: 118%;
    display: block;
    margin: -12px 0 -22px -8%;
    transform: none;
    transform-origin: bottom center;
    filter: drop-shadow(0 18px 24px rgba(0,0,0,.62));
}

.main-area {
    min-width: 0;
    padding: 24px 24px 32px;
}
.layout-three {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 22px;
    max-width: 1480px;
    margin: 0 auto;
}
.games-column { min-width: 0; }
.hero-row,
.section-head {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 14px;
}
.hero-row > div:first-child { min-width: 0; }
.top-location {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 10px;
    color: #ddc49c;
    white-space: nowrap;
}
.top-location span { color: var(--gold-2); }
.top-location i {
    width: 7px;
    height: 7px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
}
.muted,
.lead { color: var(--muted); }
.lead {
    font-size: 16px;
    line-height: 1.55;
    margin: 8px 0 22px;
}

.top-filters {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 12px;
    margin: 0 0 14px;
}
.top-filters.single-line { grid-template-columns: minmax(240px, 1fr) auto auto; }
.filter-control {
    display: flex;
    align-items: center;
    min-height: 38px;
    border: 1px solid rgba(204, 153, 89, .35);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(22,18,13,.95), rgba(13,11,8,.95));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
}
.filter-control > span {
    flex: 0 0 38px;
    color: #d9b57b;
    text-align: center;
    font-size: 18px;
}
input,
select,
textarea {
    width: 100%;
    color: var(--text);
    background: rgba(15, 13, 10, .88);
    border: 1px solid rgba(204, 153, 89, .28);
    border-radius: var(--radius);
    padding: 11px 13px;
    outline: none;
}
.filter-control input,
.filter-control select {
    min-height: 36px;
    padding: 0 33px 0 0;
    border: 0;
    border-radius: 0;
    background-color: transparent;
}
select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #d5b47c 50%),
        linear-gradient(135deg, #d5b47c 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}
textarea { resize: vertical; }
input:focus,
select:focus,
textarea:focus {
    border-color: rgba(225, 187, 122, .58);
    box-shadow: 0 0 0 3px rgba(202, 154, 91, .12);
}
.filter-submit { display: none !important; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid rgba(213, 162, 93, .38);
    border-radius: var(--radius);
    color: #eed7af;
    background: linear-gradient(180deg, rgba(40,30,18,.9), rgba(19,15,10,.9));
    cursor: pointer;
    white-space: nowrap;
}
.button.primary {
    background: linear-gradient(180deg, #d5a35f, #8e5b27);
    color: #160f08;
    font-weight: 800;
}
.button.ghost { background: rgba(16, 14, 10, .52); }
.button.small {
    min-height: 32px;
    padding: 7px 10px;
    border-radius: 5px;
    font-size: 13px;
}

.game-list {
    display: grid;
    gap: 10px;
}
.game-card {
    --type-color: var(--gold);
    display: grid;
    grid-template-columns: 84px minmax(245px, 31%) minmax(250px, 1fr) 300px;
    grid-template-areas: "type banner body meta";
    min-height: 174px;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid rgba(211, 158, 93, .28);
    background:
        linear-gradient(90deg, rgba(22,21,19,.98), rgba(13,13,12,.98)),
        radial-gradient(circle at 15% 20%, rgba(186,128,62,.12), transparent 40%);
    box-shadow: 0 14px 42px rgba(0,0,0,.36);
}
.game-card.type-nri { --type-color: var(--nri); }
.game-card.type-wargame { --type-color: var(--wargame); }
.game-card.type-boardgame { --type-color: var(--boardgame); }
.game-card.type-mafia { --type-color: var(--mafia); }
.type-panel {
    grid-area: type;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    padding: 12px 8px;
    color: var(--type-color);
    border-left: 5px solid var(--type-color);
    border-right: 1px solid rgba(255,255,255,.06);
    background:
        linear-gradient(90deg, rgba(95, 59, 26, .24), rgba(18,16,13,.85)),
        rgba(20,18,15,.86);
}
.game-card.type-nri .type-panel { background: linear-gradient(90deg, rgba(82, 43, 137, .62), rgba(25, 17, 36, .86)); }
.game-card.type-wargame .type-panel { background: linear-gradient(90deg, rgba(49, 91, 37, .62), rgba(17, 31, 15, .86)); }
.game-card.type-boardgame .type-panel { background: linear-gradient(90deg, rgba(24, 91, 118, .62), rgba(12, 29, 38, .86)); }
.game-card.type-mafia .type-panel { background: linear-gradient(90deg, rgba(118, 38, 38, .62), rgba(39, 15, 14, .86)); }
.type-symbol {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid currentColor;
    box-shadow: inset 0 0 14px rgba(255,255,255,.08);
    font-size: 25px;
    line-height: 1;
}
.type-label {
    font-family: var(--ui);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.game-banner {
    grid-area: banner;
    display: block;
    position: relative;
    min-height: 174px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    transition: filter .18s ease, transform .18s ease;
}
.game-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent 70%, rgba(12,12,11,.9)),
        linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.24));
    transition: background .18s ease;
}
.game-banner:hover,
.game-banner:focus-visible {
    filter: saturate(1.12) brightness(1.08);
}
.game-banner:hover::after,
.game-banner:focus-visible::after {
    background:
        linear-gradient(90deg, transparent 64%, rgba(12,12,11,.78)),
        linear-gradient(180deg, rgba(255,255,255,.09), rgba(0,0,0,.16));
}
.game-body {
    grid-area: body;
    min-width: 0;
    padding: 24px 22px 18px;
}
.game-title-row {
    display: grid;
    gap: 9px;
}
.game-title-row h2 {
    min-width: 0;
    color: #f4e6ce;
    font-size: 25px;
    line-height: 1.08;
}
.game-body p {
    max-width: 46ch;
    margin: 12px 0 0;
    color: #d9c7aa;
    font-size: 15px;
    line-height: 1.45;
}
.game-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 13px;
}
.game-roles span {
    max-width: 100%;
    padding: 5px 8px;
    border: 1px solid rgba(218, 170, 101, .34);
    border-radius: 5px;
    color: #efd0a0;
    background: rgba(36, 25, 14, .74);
    font-family: var(--ui);
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pill {
    display: inline-flex;
    align-items: center;
    width: max-content;
    padding: 4px 9px;
    border-radius: 5px;
    font-family: var(--ui);
    font-size: 12px;
    font-weight: 700;
    color: #11100c;
    background: rgba(255,255,255,.08);
}
.type-pill.type-nri { background-color: #6f48b8; color: #fff; }
.type-pill.type-wargame { background-color: #5d943f; color: #10200d; }
.type-pill.type-boardgame { background-color: #238bb0; color: #071922; }
.type-pill.type-mafia { background-color: #a93c38; color: #fff; }
.pill.type-nri { background-color: #6f48b8; color: #fff; }
.pill.type-wargame { background-color: #5d943f; color: #10200d; }
.pill.type-boardgame { background-color: #238bb0; color: #071922; }
.pill.type-mafia { background-color: #a93c38; color: #fff; }
.game-meta {
    grid-area: meta;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-width: 0;
    padding: 22px 48px 16px 20px;
    border-left: 1px solid rgba(213, 162, 93, .18);
    background: linear-gradient(90deg, rgba(9,9,8,.24), rgba(15,14,13,.7));
}
.bookmark {
    position: absolute;
    top: 17px;
    right: 17px;
    width: 24px;
    height: 28px;
    padding: 0;
    border: 0;
    color: #d5bd93;
    background: transparent;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}
.master-line {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 33px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(220, 177, 111, .14);
}
.avatar {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    flex: 0 0 30px;
    border-radius: 50%;
    border: 1px solid rgba(222, 179, 113, .45);
    background: radial-gradient(circle, rgba(197, 134, 66, .5), rgba(31, 23, 16, .95));
    color: #f5ddad;
    font-family: var(--ui);
    font-weight: 800;
}
.master-line strong,
.meta-line strong {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #ead8b8;
    font-size: 15px;
    font-weight: 500;
}
.meta-line {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.meta-line span {
    width: 17px;
    flex: 0 0 17px;
    color: #e2bd80;
    text-align: center;
    line-height: 1;
}
.capacity {
    height: 5px;
    margin: 2px 0 0 27px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
}
.capacity i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--type-color), #f2d79e);
}
.join-form { margin-top: auto; }
.join-form .button { width: 100%; }
button:disabled { opacity: .5; cursor: not-allowed; }

.right-panel {
    position: sticky;
    top: 22px;
    align-self: start;
}
.date-panel,
.content-card {
    border: 1px solid rgba(211, 158, 93, .28);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(27,22,16,.96), rgba(12,10,8,.96)),
        radial-gradient(circle at 50% 0%, rgba(150, 91, 38, .14), transparent 42%);
    box-shadow: var(--shadow);
}
.date-panel {
    padding: 24px 22px 18px;
    background-color: #120d08;
    background-image:
        linear-gradient(180deg, rgba(12,10,8,.72), rgba(12,10,8,.86)),
        url("../images/bg_right_panel_texture.png");
    background-size: auto, 100% 100%;
    background-position: center;
}
.date-panel h2 {
    position: relative;
    margin-bottom: 18px;
    text-align: center;
    font-size: 28px;
}
.date-panel h2::after {
    content: "";
    display: block;
    width: 155px;
    height: 1px;
    margin: 12px auto 0;
    background: linear-gradient(90deg, transparent, rgba(222,176,109,.44), transparent);
}
.calendar {
    padding: 6px 4px 20px;
    border-bottom: 1px solid rgba(213, 162, 93, .17);
}
.calendar-head {
    display: grid;
    grid-template-columns: 38px 1fr 38px;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}
.calendar-head a {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: #f0d3a1;
    border-radius: 50%;
    font-size: 34px;
    line-height: 1;
}
.calendar-head a:hover { background: rgba(213,162,93,.12); }
.calendar-head strong {
    text-align: center;
    color: #f0d3a1;
    font-size: 22px;
}
.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
}
.calendar-weekdays {
    margin-bottom: 9px;
    color: #d5bd93;
    font-size: 14px;
}
.calendar-grid {
    row-gap: 8px;
    color: #f0dfc3;
}
.calendar-grid a {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    justify-self: center;
    border-radius: 50%;
    font-size: 17px;
}
.calendar-grid a:hover {
    background: rgba(213,162,93,.14);
    color: #ffe5b4;
}
.calendar-grid .muted-day {
    color: rgba(206, 184, 150, .42);
}
.calendar-grid .selected {
    color: #fff;
    background: radial-gradient(circle, #8f63d7, #64419f);
    box-shadow: 0 0 0 3px rgba(132, 88, 201, .22);
}
.calendar-grid .today:not(.selected) {
    color: #ffdca8;
    box-shadow: inset 0 0 0 1px rgba(222,176,109,.45);
}
.today-link {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    color: #d9bf96;
    font-size: 15px;
}
.quick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 20px 0;
    border-bottom: 1px solid rgba(213, 162, 93, .17);
}
.quick-grid a,
.reset-link {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(204, 153, 89, .3);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(33,26,17,.82), rgba(18,14,10,.82));
    color: #e2c8a0;
}
.panel-section {
    display: grid;
    gap: 10px;
    padding: 20px 0 0;
}
.panel-section h3 {
    color: #e0b979;
    font-size: 18px;
}
.panel-section select {
    min-height: 38px;
    background-color: rgba(16, 13, 10, .84);
}
.reset-link {
    margin-top: 8px;
    min-height: 42px;
}

.legend {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}
.legend-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid rgba(226,190,111,.13);
    border-radius: var(--radius);
    background: rgba(255,255,255,.04);
}
.legend-item i {
    width: 10px;
    height: 28px;
    border-radius: 999px;
    display: block;
}
.legend-item.type-nri i { background: var(--nri); }
.legend-item.type-wargame i { background: var(--wargame); }
.legend-item.type-boardgame i { background: var(--boardgame); }
.legend-item.type-mafia i { background: var(--mafia); }

.game-detail {
    --type-color: var(--gold);
}
.game-detail.type-nri { --type-color: var(--nri); }
.game-detail.type-wargame { --type-color: var(--wargame); }
.game-detail.type-boardgame { --type-color: var(--boardgame); }
.game-detail.type-mafia { --type-color: var(--mafia); }
.detail-hero {
    display: grid;
    grid-template-columns: 86px minmax(330px, .48fr) minmax(0, 1fr);
    min-height: 330px;
    overflow: hidden;
    border: 1px solid rgba(211, 158, 93, .25);
    border-radius: var(--radius);
    background: linear-gradient(90deg, rgba(21,19,16,.96), rgba(12,11,10,.96));
}
.detail-type {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 13px;
    padding: 14px 8px;
    color: var(--type-color);
    border-left: 5px solid var(--type-color);
    border-right: 1px solid rgba(255,255,255,.07);
    background: linear-gradient(90deg, rgba(95, 59, 26, .2), rgba(18,16,13,.86));
}
.detail-banner {
    position: relative;
    min-height: 330px;
    background-size: cover;
    background-position: center;
}
.detail-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent 64%, rgba(11,11,10,.86)),
        linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.26));
}
.detail-summary {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    padding: 30px;
    min-width: 0;
}
.detail-summary h2 {
    color: #f1d9ad;
    font-size: 24px;
}
.detail-summary p,
.detail-main p {
    color: #dfcdb0;
    font-size: 16px;
    line-height: 1.58;
}
.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 22px;
    margin-top: 22px;
}
.detail-main {
    display: grid;
    gap: 16px;
    align-content: start;
}
.detail-main h2 {
    margin-top: 6px;
}
.detail-roles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}
.detail-roles div {
    display: grid;
    gap: 6px;
    padding: 13px 14px;
    border: 1px solid rgba(218, 170, 101, .22);
    border-radius: var(--radius);
    background: rgba(17, 13, 9, .42);
}
.detail-roles strong {
    color: #f1d6a6;
}
.detail-roles span {
    color: var(--muted);
    line-height: 1.45;
}
.detail-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-self: start;
    padding: 20px;
    border: 1px solid rgba(218, 170, 101, .2);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(28,22,15,.74), rgba(12,10,8,.72)),
        radial-gradient(circle at 50% 0%, rgba(184, 119, 48, .12), transparent 48%);
}
.detail-side .capacity {
    margin-left: 27px;
}
.detail-side .button {
    width: 100%;
}

.content-card {
    padding: 28px;
    max-width: 1180px;
    margin: 0 auto;
}
.content-card.narrow { max-width: 680px; }
.content-card.wide { max-width: 1220px; }
.form-grid { display: grid; gap: 16px; }
.form-grid.two-cols { grid-template-columns: 1fr 1fr; }
.form-grid label {
    display: grid;
    gap: 8px;
    color: #e8d7b9;
    font-weight: 650;
}
.form-grid .full { grid-column: 1 / -1; }
.form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}
.roles-editor {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid rgba(218, 170, 101, .18);
    border-radius: var(--radius);
    background: rgba(10, 8, 6, .26);
}
.roles-editor h2 {
    font-size: 22px;
}
.roles-editor .muted {
    margin: -4px 0 4px;
}
.role-row {
    display: grid;
    grid-template-columns: minmax(170px, .42fr) minmax(220px, 1fr);
    gap: 10px;
}
.alert,
.notice {
    padding: 14px 16px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    border: 1px solid rgba(255,255,255,.12);
}
.alert.success {
    background: rgba(58, 119, 52, .18);
    color: #d9ffd5;
    border-color: rgba(139, 207, 133, .24);
}
.alert.error {
    background: rgba(135, 45, 45, .22);
    color: #ffd7d7;
    border-color: rgba(212, 91, 91, .28);
}
.notice {
    background: rgba(214, 168, 79, .12);
    color: #f1d99b;
}
.empty-state {
    padding: 34px;
    border-radius: var(--radius);
    background: rgba(255,255,255,.04);
    border: 1px dashed rgba(226,190,111,.25);
}
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid rgba(226,190,111,.14);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}
.data-table th,
.data-table td {
    padding: 14px;
    border-bottom: 1px solid rgba(226,190,111,.1);
    text-align: left;
    vertical-align: middle;
}
.data-table th {
    color: var(--gold-2);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    background: rgba(255,255,255,.035);
}
.row-actions,
.inline-admin-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.row-actions form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.link-button {
    background: none;
    border: none;
    padding: 0;
    color: var(--gold-2);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}
.link-button.danger { color: #ff9b9b; }
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin: 24px 0;
}
.stat-grid div {
    padding: 20px;
    border-radius: var(--radius);
    background: rgba(255,255,255,.045);
    border: 1px solid rgba(226,190,111,.14);
}
.stat-grid strong {
    display: block;
    font-size: 34px;
    color: var(--gold-2);
}
.stat-grid span { color: var(--muted); }
.admin-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.phrase-table {
    margin-top: 22px;
}
.phrase-form {
    width: 100%;
    align-items: stretch;
}
.phrase-form textarea {
    min-width: min(520px, 100%);
}
.check-label {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.check-label input { width: auto; }
code {
    background: rgba(255,255,255,.08);
    padding: 2px 6px;
    border-radius: 6px;
}

@media (max-width: 1400px) {
    .layout-three { grid-template-columns: minmax(0, 1fr) 340px; }
    .game-card { grid-template-columns: 76px minmax(220px, 30%) minmax(230px, 1fr) 270px; }
    .game-title-row h2 { font-size: 23px; }
    .game-meta { padding-right: 42px; }
}

@media (max-width: 1180px) {
    .layout-three { grid-template-columns: 1fr; }
    .right-panel { position: static; }
    .date-panel {
        display: grid;
        grid-template-columns: minmax(300px, 360px) minmax(260px, 1fr);
        gap: 20px;
        align-items: start;
    }
    .date-panel h2 { grid-column: 1 / -1; }
    .calendar { border-bottom: 0; padding-bottom: 0; }
    .quick-grid,
    .panel-section { padding-top: 0; }
    .game-card { grid-template-columns: 78px minmax(240px, 32%) minmax(0, 1fr); grid-template-areas: "type banner body" "type banner meta"; }
    .game-meta { border-left: 0; border-top: 1px solid rgba(213, 162, 93, .18); }
}

@media (max-width: 900px) {
    .app-shell { display: block; }
    .sidebar {
        position: relative;
        height: auto;
        padding-bottom: 18px;
    }
    .brand { grid-template-columns: auto 1fr; justify-items: start; align-items: center; text-align: left; padding-bottom: 12px; }
    .brand-logo { width: 138px; }
    .brand::after { left: 68px; top: 32px; width: 10px; height: 10px; }
    .brand-subtitle { margin-top: 0; }
    .side-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 0 12px;
        padding-bottom: 0;
    }
    .side-nav a {
        min-height: 44px;
        padding: 0 12px;
        border: 1px solid rgba(216,164,91,.16);
        border-radius: var(--radius);
        font-size: 13px;
    }
    .side-nav a.active::after { display: none; }
    .mascot-card {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        min-height: 0;
        margin: 14px 12px 0;
    }
    .mascot-img {
        max-height: 180px;
        object-fit: cover;
        object-position: center 24%;
        width: 100%;
        margin: 0;
        transform: none;
    }
    .main-area { padding: 18px; }
    .hero-row,
    .section-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .top-location { margin-left: 0; padding-left: 0; }
    .top-filters,
    .top-filters.single-line {
        grid-template-columns: 1fr;
    }
    .filter-submit { display: inline-flex !important; }
    .game-card {
        grid-template-columns: 76px minmax(0, 1fr);
        grid-template-areas:
            "type banner"
            "body body"
            "meta meta";
    }
    .game-banner { min-height: 155px; }
    .game-meta { padding-right: 46px; }
    .date-panel {
        display: block;
    }
    .detail-hero {
        grid-template-columns: 76px minmax(0, 1fr);
    }
    .detail-type {
        grid-row: 1 / span 2;
    }
    .detail-banner {
        min-height: 230px;
    }
    .detail-summary {
        padding: 20px;
    }
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .phrase-form {
        display: grid;
    }
    .phrase-form textarea {
        min-width: 0;
    }
    .calendar { padding-bottom: 20px; border-bottom: 1px solid rgba(213, 162, 93, .17); }
    .quick-grid,
    .panel-section { padding-top: 20px; }
    .form-grid.two-cols,
    .stat-grid {
        grid-template-columns: 1fr;
    }
    .role-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    h1 { font-size: 29px; }
    h2 { font-size: 22px; }
    .side-nav { grid-template-columns: 1fr; }
    .game-card {
        grid-template-columns: 1fr;
        grid-template-areas:
            "type"
            "banner"
            "body"
            "meta";
    }
    .type-panel {
        min-height: 58px;
        grid-template-columns: auto auto;
        justify-content: start;
        padding-left: 16px;
        border-left-width: 6px;
    }
    .detail-hero {
        grid-template-columns: 1fr;
    }
    .detail-type {
        min-height: 58px;
        grid-row: auto;
        grid-template-columns: auto auto;
        justify-content: start;
        padding-left: 16px;
        border-left-width: 6px;
    }
    .detail-banner {
        min-height: 205px;
    }
    .detail-summary {
        padding: 18px 16px;
    }
    .game-banner { min-height: 145px; }
    .game-body,
    .game-meta { padding-left: 16px; padding-right: 16px; }
    .bookmark { right: 16px; }
    .quick-grid { grid-template-columns: 1fr; }
}
