/* Rowdy Rounds — football table */

.main-content {
    padding: 40px 32px 64px;
}

.table-layout {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
}

.table-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 380px;
    max-width: 520px;
}

.table-header {
    text-align: center;
    max-width: 520px;
    margin-bottom: 28px;
}

.table-title {
    font-size: 2.6rem;
    color: var(--felt);
}

.table-subtitle {
    margin: 8px 0 0;
    color: rgba(27, 27, 23, 0.65);
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.start-btn {
    padding: 16px 36px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: var(--font-display);
    letter-spacing: 0.02em;
    background-color: var(--felt);
    color: var(--chalk);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 6px 0 var(--felt-dark);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.start-btn:hover {
    transform: translateY(2px);
    box-shadow: 0 4px 0 var(--felt-dark);
}

.player-section {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.player-input {
    padding: 12px 14px;
    font-size: 1rem;
    border: 2px solid var(--felt);
    border-radius: 6px;
    font-family: var(--font-body);
    width: 240px;
}

.add-player-btn, .next-btn {
    padding: 10px 22px;
    font-size: 0.95rem;
    font-weight: 600;
    background-color: var(--felt);
    color: var(--chalk);
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.next-btn {
    background-color: var(--ember);
    /* Extra breathing room above the flex gap - it's a separate step
       (moving on to the round) from the name input + Add player pair
       right above it. */
    margin-top: 12px;
}

/* Scoreboard */
.player-list {
    padding: 18px 20px;
    background-color: var(--felt);
    color: var(--chalk);
    border-radius: 10px;
    border: 1px solid var(--line);
    display: none;
    position: sticky;
    top: 24px;
    flex: 0 0 320px;
    width: 320px;
    max-width: 100%;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

.panel-title {
    font-size: 1rem;
    color: var(--foil);
    margin-bottom: 10px;
}

#player-rules-section .panel-title {
    margin-top: 18px;
}

.player-list table {
    width: 100%;
    border-collapse: collapse;
}

.player-list th, .player-list td {
    padding: 7px 4px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    font-size: 0.9rem;
}

.player-list th {
    font-weight: 600;
    color: rgba(244, 239, 228, 0.7);
    font-size: 0.75rem;
    text-transform: none;
}

#player-rules-section {
    display: none;
}

/* Turn-based games with no score (King's Cup) */
.turn-indicator {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--felt);
    margin-bottom: 16px;
    text-align: center;
}

.player-list.turn-order li {
    list-style: none;
    padding: 7px 4px;
    border-bottom: 1px solid var(--line);
    font-size: 0.9rem;
}

.player-list.turn-order ul {
    margin: 0;
    padding: 0;
}

.player-list.turn-order li.current-turn {
    color: var(--foil);
    font-weight: 600;
}

/* Scoreboard games (script.js, truth_or_drink.js) - highlight whose turn
   it is to draw/resolve a card right in the scoreboard row. */
.player-list table tr.current-turn td {
    color: var(--foil);
    font-weight: 600;
}

.player-list table tr.current-turn td:first-child {
    position: relative;
}

.player-list table tr.current-turn td:first-child::before {
    content: '\25B8';
    position: absolute;
    left: -12px;
}

/* Card table */
.card-section {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 380px;
    position: relative;
}

.card {
    width: 100%;
    aspect-ratio: 5 / 7;
    position: relative;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    cursor: pointer;
    margin-bottom: 18px;
}

.card > div {
    width: 100%;
    height: 100%;
    position: absolute;
    display: flex;
    flex-direction: column;
    backface-visibility: hidden;
    border-radius: 16px;
    border: 3px solid var(--felt-dark);
    box-shadow: 0 16px 24px rgba(0, 0, 0, 0.22);
    padding: 18px;
}

.card-front {
    background-color: var(--felt);
    justify-content: center;
    align-items: center;
    gap: 14px;
}

.card-front-logo {
    width: 84px;
    opacity: 0.9;
}

.card-front-emoji {
    font-size: 4.5rem;
    line-height: 1;
    opacity: 0.9;
}

.card-title {
    font-size: 1.5rem;
    color: var(--chalk);
}

.card-corner {
    position: absolute;
    left: 14px;
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--foil);
    line-height: 1;
}

.card-corner--top {
    top: 14px;
}

.card-corner--bottom {
    bottom: 14px;
    transform: rotate(180deg);
}

.card-back {
    background-color: var(--chalk);
    transform: rotateY(180deg);
    justify-content: center;
    align-items: center;
    text-align: center;
}

.card-back .card-corner {
    color: var(--felt);
}

.card-back-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 100%;
}

.card-back-title {
    font-size: 1.6rem;
    color: var(--ink);
}

.card-description {
    font-size: 1rem;
    color: rgba(27, 27, 23, 0.75);
    line-height: 1.4;
    margin: 0;
}

.card-points {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--foil-dark);
    margin: 0;
}

.card.flip .card-front {
    transform: rotateY(180deg);
}

.card.flip .card-back {
    transform: rotateY(0deg);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.card {
    animation: slideIn 0.4s ease;
}

.table-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 6px;
}

.table-actions button {
    padding: 11px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

/* "Go/no penalty" actions (Add to hand, I'll answer, Next) */
#add-rule-btn, #answer-btn, #next-card-btn {
    background-color: var(--felt);
    color: var(--chalk);
}

#add-rule-btn:hover, #answer-btn:hover, #next-card-btn:hover {
    background-color: var(--felt-dark);
}

/* "Penalty" actions (Skip for 2 sips, I'll drink) */
#skip-rule-btn, #drink-btn {
    background-color: var(--ember);
    color: var(--chalk);
}

#skip-rule-btn:hover, #drink-btn:hover {
    background-color: var(--ember-dark);
}

.reset-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    background: none;
    color: rgba(27, 27, 23, 0.5);
    border: none;
    cursor: pointer;
    margin-top: 14px;
    text-decoration: underline;
}

/* Settings */
.settings-btn {
    background: none;
    border: none;
    cursor: pointer;
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
}

.settings-icon {
    width: 22px;
    height: 22px;
}

.settings-menu {
    background-color: var(--chalk);
    border: 2px solid var(--felt);
    border-radius: 8px;
    padding: 16px;
    position: absolute;
    top: 48px;
    right: 16px;
    z-index: 30;
    min-width: 220px;
}

.settings-menu h3 {
    font-size: 0.95rem;
    color: var(--felt);
    margin-bottom: 10px;
}

.settings-menu form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-menu label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.settings-menu button {
    background-color: var(--felt);
    color: var(--chalk);
    border: none;
    padding: 8px 14px;
    margin-top: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

/* Player rule "hand" cards */
#player-rules-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

#player-rules-table th, #player-rules-table td {
    padding: 8px 4px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    font-size: 0.85rem;
    vertical-align: top;
}

.player-rule-card-container {
    position: relative;
    width: 100%;
    height: 96px;
    display: flex;
}

.player-rule-name-container {
    white-space: nowrap;
    padding-top: 12px !important;
}

.player-rule-card {
    position: absolute;
    width: 68px;
    height: 88px;
    border: 1px solid var(--foil-dark);
    border-radius: 8px;
    background-color: var(--chalk);
    color: var(--ink);
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.25);
    padding: 6px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    transition: transform 0.15s ease, z-index 0.2s ease;
    cursor: pointer;
}

.player-rule-card:hover {
    z-index: 999 !important;
    transform: scale(1.25) translateY(-6px);
}

.small-card-title {
    font-size: 0.62rem;
    font-weight: 700;
    text-align: center;
    color: var(--felt);
}

.small-card-description {
    font-size: 0.56rem;
    text-align: center;
    max-width: 100%;
    color: rgba(27, 27, 23, 0.7);
    margin-top: 3px;
}

/* Tutorial ("how to play") modal */
.tutorial-help-btn {
    display: block;
    margin: 10px auto 0;
    background: none;
    border: none;
    color: var(--felt);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

.tutorial-content {
    text-align: left;
    max-width: 420px;
}

.tutorial-content h2 {
    text-align: center;
    color: var(--felt);
    font-size: 1.4rem;
    margin-bottom: 18px;
}

.tutorial-steps {
    margin: 0 0 20px;
    padding-left: 22px;
    line-height: 1.6;
    color: rgba(27, 27, 23, 0.85);
}

.tutorial-steps li {
    margin-bottom: 8px;
}

.tutorial-dont-show {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: rgba(27, 27, 23, 0.75);
    cursor: pointer;
}

/* Forbidden Words */
.team-setup {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.team-setup input {
    padding: 12px 14px;
    font-size: 1rem;
    border: 2px solid var(--felt);
    border-radius: 6px;
    font-family: var(--font-body);
    width: 240px;
}

.forbidden-round-header {
    text-align: center;
    margin-bottom: 16px;
}

.forbidden-turn-label {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--felt);
}

.forbidden-timer {
    font-family: var(--font-display);
    font-size: 2.4rem;
    color: var(--ember);
    margin: 4px 0 0;
}

.forbidden-timer.urgent {
    color: var(--ember-dark);
    animation: forbidden-pulse 0.6s ease infinite alternate;
}

@keyframes forbidden-pulse {
    from { opacity: 1; }
    to { opacity: 0.4; }
}

.forbidden-card {
    width: 100%;
    max-width: 380px;
    background-color: var(--felt);
    border: 3px solid var(--felt-dark);
    border-radius: 16px;
    box-shadow: 0 16px 24px rgba(0, 0, 0, 0.22);
    padding: 28px 24px;
    text-align: center;
    margin-bottom: 18px;
}

.forbidden-target {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--chalk);
    margin-bottom: 18px;
}

.forbidden-words {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.forbidden-words li {
    font-size: 1.05rem;
    color: var(--ember);
    font-weight: 600;
}

.forbidden-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 12px;
}

.forbidden-actions button {
    padding: 11px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

#correct-btn {
    background-color: var(--felt);
    color: var(--chalk);
}

#skip-btn {
    background-color: rgba(27, 27, 23, 0.5);
    color: var(--chalk);
}

#forbidden-btn {
    background-color: var(--ember);
    color: var(--chalk);
}

#start-round-btn {
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-display);
    letter-spacing: 0.02em;
    background-color: var(--felt);
    color: var(--chalk);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 6px 0 var(--felt-dark);
}

@media (max-width: 768px) {
    .player-list {
        position: static;
        /* flex-basis (not width) governs a flex item's main size, so the
           base rule's `flex: 0 0 320px` must be reset here too - width:100%
           alone is silently ignored and the panel stays pinned at 320px,
           overflowing on phones narrower than ~384px. */
        flex: 1 1 100%;
        width: 100%;
        margin-top: 24px;
    }

    .settings-menu {
        right: 8px;
        left: 8px;
        min-width: unset;
    }
}
