/*
 * Party Games Theme - built on top of SeoEngineBundle tokens.
 * Design system compliant: contrast >= 4.5:1, tap targets >= 44px.
 */
:root {
    --c-accent: #6d28d9;
    --c-accent-hover: #5b21b6;
    --c-link: #6d28d9;
    --c-truth: #059669;
    --c-dare: #dc2626;
    --radius-party: 16px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --c-accent: #a78bfa;
        --c-accent-hover: #c4b5fd;
        --c-link: #a78bfa;
        --c-truth: #34d399;
        --c-dare: #f87171;
    }
}

/* Catalog of games on Home */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.game-card-item {
    background: var(--c-surface, #fff);
    border: 1px solid var(--c-border, #e5e7eb);
    border-radius: var(--radius-party);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    text-decoration: none;
    color: inherit;
}

.game-card-item:hover {
    transform: translateY(-2px);
    border-color: var(--c-accent);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.game-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.game-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(109, 40, 217, 0.1);
    color: var(--c-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.game-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.game-card-desc {
    color: var(--c-text-muted, #4b5563);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 1rem;
    flex-grow: 1;
}

.game-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid var(--c-border, #f3f4f6);
}

.game-card-action {
    color: var(--c-accent);
    font-weight: 600;
    font-size: 0.95rem;
}

/* Category pills */
.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 1rem 0 1.5rem;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--c-surface, #fff);
    border: 1px solid var(--c-border, #e5e7eb);
    border-radius: 9999px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    color: inherit;
    min-height: 44px;
    transition: all 0.15s ease;
}

.category-pill:hover, .category-pill.active {
    background: var(--c-accent);
    border-color: var(--c-accent);
    color: #fff;
}

.category-pill.pill-adult {
    border-color: rgba(220, 38, 38, 0.3);
    color: var(--c-dare);
}
.category-pill.pill-adult:hover, .category-pill.pill-adult.active {
    background: var(--c-dare);
    border-color: var(--c-dare);
    color: #fff;
}

/* Play Screen & Card Stage */
.play-stage {
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
}

.sound-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--c-surface, #fff);
    border: 1px solid var(--c-border, #e5e7eb);
    border-radius: var(--radius-party);
    margin-bottom: 1.5rem;
}

.sound-btn-group {
    display: flex;
    gap: 0.5rem;
}

.sound-toggle-btn {
    min-height: 44px;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--c-border, #e5e7eb);
    background: transparent;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.sound-toggle-btn.active {
    background: var(--c-accent);
    color: #fff;
    border-color: var(--c-accent);
}

.party-card-box {
    background: var(--c-surface, #fff);
    border: 2px solid var(--c-border, #e5e7eb);
    border-radius: 20px;
    padding: 2.5rem 1.5rem;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-flip {
    animation: flipCard 0.35s ease;
}

@keyframes flipCard {
    0% { transform: scale(0.95) rotateY(15deg); opacity: 0.5; }
    100% { transform: scale(1) rotateY(0); opacity: 1; }
}

.card-badge {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    background: rgba(109, 40, 217, 0.1);
    color: var(--c-accent);
    margin-bottom: 1.25rem;
}

.card-badge.badge-truth {
    background: rgba(5, 150, 105, 0.15);
    color: var(--c-truth);
}

.card-badge.badge-dare {
    background: rgba(220, 38, 38, 0.15);
    color: var(--c-dare);
}

.card-main-text {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.45;
    margin: 0;
    color: var(--c-text);
}

.card-counter {
    font-size: 0.85rem;
    color: var(--c-text-muted);
    margin-top: 1rem;
}

/* Action buttons */
.play-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.btn-party {
    min-height: 52px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.1s ease, filter 0.1s ease;
}

.btn-party:active {
    transform: scale(0.97);
}

.btn-truth {
    background: var(--c-truth);
    color: #fff;
}

.btn-dare {
    background: var(--c-dare);
    color: #fff;
}

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

.btn-secondary-party {
    background: var(--c-surface, #fff);
    border: 2px solid var(--c-border, #e5e7eb);
    color: var(--c-text);
}

/* Alias Timer */
.timer-box {
    background: var(--c-surface, #fff);
    border: 2px solid var(--c-border);
    border-radius: var(--radius-party);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.timer-digits {
    font-size: 4rem;
    font-weight: 900;
    font-family: monospace;
    letter-spacing: -0.05em;
    color: var(--c-text);
    margin: 0.5rem 0;
}

.timer-urgent {
    color: var(--c-dare);
    animation: pulseTimer 0.5s infinite alternate;
}

@keyframes pulseTimer {
    from { transform: scale(1); }
    to { transform: scale(1.06); }
}

.teams-scoreboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.team-score-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.score-display {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0.25rem 0 0.75rem;
}

.score-btn-group {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.score-btn {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid var(--c-border);
    background: var(--c-surface);
    font-size: 1.25rem;
    font-weight: bold;
    cursor: pointer;
}

/* Bunker layout */
.bunker-briefing-box {
    background: rgba(109, 40, 217, 0.05);
    border: 2px dashed var(--c-accent);
    border-radius: var(--radius-party);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.bunker-catastrophe-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--c-dare);
    margin-bottom: 0.5rem;
}

.bunker-players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.bunker-player-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: left;
}

.bunker-player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--c-border);
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.bunker-attributes .attr-row {
    padding: 0.45rem 0;
    font-size: 0.95rem;
    border-bottom: 1px dotted rgba(150, 150, 150, 0.2);
}

.attr-label {
    font-weight: 600;
    color: var(--c-text-muted);
    margin-right: 0.35rem;
}

.spoiler-row {
    cursor: pointer;
}

.spoiler-row .hidden-val {
    color: var(--c-accent);
    font-style: italic;
}

.spoiler-row.opened {
    background: rgba(5, 150, 105, 0.04);
}

.special-action {
    color: var(--c-dare);
    font-weight: 600;
}

/* Bottle game */
.bottle-stage {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 2rem auto;
    border-radius: 50%;
    border: 4px solid var(--c-border);
    background: radial-gradient(circle at center, #ffffff 0%, #f9fafb 65%, #e5e7eb 100%);
    box-shadow: inset 0 4px 14px rgba(0, 0, 0, 0.08), 0 10px 30px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.bottle-spinner {
    width: 70px;
    height: 220px;
    position: relative;
    transform-origin: 50% 50%;
    will-change: transform;
    cursor: pointer;
}

.rules-accordion {
    margin-top: 2rem;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-party);
    padding: 1.25rem 1.5rem;
    text-align: left;
}

.rules-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

/* =========================================================
   Шляпа (The Hat Game Engine Styles)
   ========================================================= */
.shlyapa-setup-box {
    background: var(--c-surface, #fff);
    border: 2px solid var(--c-border, #e5e7eb);
    border-radius: var(--radius-party, 16px);
    padding: 1.75rem 1.5rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.shlyapa-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 1.25rem 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.shlyapa-section-title:first-child {
    margin-top: 0;
}

.shlyapa-teams-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1rem;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 680px) {
    .shlyapa-teams-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.shlyapa-pair-card {
    background: rgba(109, 40, 217, 0.03);
    border: 1px solid var(--c-border, #e5e7eb);
    border-radius: 12px;
    padding: 0.75rem 0.85rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.shlyapa-pair-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(109, 40, 217, 0.1);
    padding-bottom: 0.35rem;
}

.shlyapa-pair-badge {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--c-accent);
    background: rgba(109, 40, 217, 0.1);
    padding: 0.15rem 0.55rem;
    border-radius: 6px;
    flex-shrink: 0;
}

.shlyapa-pair-title-preview {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--c-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

.shlyapa-pair-players {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

@media (max-width: 480px) {
    .shlyapa-pair-players {
        grid-template-columns: 1fr;
    }
}

.shlyapa-player-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--c-surface, #fff);
    border: 1px solid var(--c-border, #e5e7eb);
    border-radius: 8px;
    padding: 0.35rem 0.45rem;
    min-width: 0;
    box-sizing: border-box;
}

.shlyapa-player-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--c-text-muted);
    flex-shrink: 0;
}

.shlyapa-player-input {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    border: none;
    outline: none;
    font-size: 0.88rem;
    font-weight: 600;
    background: transparent;
    color: var(--c-text);
    box-sizing: border-box;
}

.shlyapa-player-input:focus {
    color: var(--c-accent);
}

.shlyapa-dice-btn {
    border: 1px solid var(--c-border);
    background: var(--c-surface, #fff);
    border-radius: 6px;
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s ease, background 0.15s ease;
}
    transition: transform 0.15s ease, background 0.15s ease;
}

.shlyapa-dice-btn:hover {
    background: rgba(109, 40, 217, 0.1);
    transform: rotate(20deg) scale(1.05);
}

.shlyapa-pill-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.shlyapa-pill-btn {
    min-height: 42px;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: 1px solid var(--c-border);
    background: var(--c-surface, #fff);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--c-text);
    cursor: pointer;
    transition: all 0.15s ease;
}

.shlyapa-pill-btn:hover {
    border-color: var(--c-accent);
}

.shlyapa-pill-btn.active {
    background: var(--c-accent);
    color: #fff;
    border-color: var(--c-accent);
    box-shadow: 0 2px 8px rgba(109, 40, 217, 0.25);
}

.shlyapa-custom-words-box {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.02);
    border: 1px dashed var(--c-border);
}

.shlyapa-custom-words-box textarea {
    width: 100%;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    padding: 0.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    margin-top: 0.5rem;
    box-sizing: border-box;
    min-height: 70px;
}

/* Play Arena */
.shlyapa-round-banner {
    background: var(--c-surface);
    border: 2px solid var(--c-border);
    border-radius: var(--radius-party, 16px);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    text-align: center;
}

.shlyapa-round-badge {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    border-radius: 9999px;
    font-weight: 800;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.shlyapa-round-badge.round-1 {
    background: rgba(109, 40, 217, 0.15);
    color: #6d28d9;
}

.shlyapa-round-badge.round-2 {
    background: rgba(217, 119, 6, 0.15);
    color: #d97706;
}

.shlyapa-round-badge.round-3 {
    background: rgba(5, 150, 105, 0.15);
    color: #059669;
}

.shlyapa-round-desc {
    font-size: 1rem;
    color: var(--c-text-muted);
    margin: 0;
    line-height: 1.4;
}

.shlyapa-hat-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(109, 40, 217, 0.08);
    border: 1px solid rgba(109, 40, 217, 0.2);
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.shlyapa-turn-indicator {
    background: var(--c-surface);
    border: 2px dashed var(--c-accent);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    text-align: center;
}

.shlyapa-turn-team-name {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--c-accent);
    margin: 0.25rem 0 0.5rem;
}

.shlyapa-word-card {
    background: var(--c-surface, #fff);
    border: 3px solid var(--c-accent);
    border-radius: 20px;
    padding: 2.5rem 1.5rem;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 12px 35px rgba(109, 40, 217, 0.1);
    margin-bottom: 1.5rem;
}

.shlyapa-word-text {
    font-size: 2.4rem;
    font-weight: 900;
    color: var(--c-text);
    text-align: center;
    line-height: 1.25;
}

.shlyapa-scoreboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.shlyapa-team-card {
    background: var(--c-surface);
    border: 2px solid var(--c-border);
    border-radius: 12px;
    padding: 0.75rem 0.5rem;
    text-align: center;
    transition: all 0.2s ease;
}

.shlyapa-team-card.active-turn {
    border-color: var(--c-accent);
    background: rgba(109, 40, 217, 0.05);
    box-shadow: 0 4px 14px rgba(109, 40, 217, 0.15);
    transform: translateY(-2px);
}

.shlyapa-team-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shlyapa-team-score-num {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    margin: 0.25rem 0;
}

.shlyapa-team-rounds-breakdown {
    font-size: 0.75rem;
    color: var(--c-text-muted);
}

/* Intermission Modal & Victory */
.shlyapa-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}

.shlyapa-modal-dialog {
    background: var(--c-surface, #fff);
    border-radius: 20px;
    border: 2px solid var(--c-accent);
    padding: 2rem;
    max-width: 520px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.shlyapa-summary-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    font-size: 0.95rem;
}

.shlyapa-summary-table th,
.shlyapa-summary-table td {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid var(--c-border);
    text-align: center;
}

.shlyapa-summary-table th:first-child,
.shlyapa-summary-table td:first-child {
    text-align: left;
}

.shlyapa-podium-rank {
    font-weight: 900;
    font-size: 1.2rem;
}
