﻿/* =========================================================
   PAGE
   ========================================================= */

.tourney-page {
    min-height: 100vh;
    color: #f4f1e9;
    background:
        radial-gradient(
            circle at top,
            #17191b 0%,
            #090a0b 55%,
            #060707 100%
        );
    background-image:
        linear-gradient(
            rgba(255,255,255,.014) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255,255,255,.014) 1px,
            transparent 1px
        );
    background-size: 6px 6px;
}


.tourney-content {
    max-width: 1500px;
    margin: 0 auto;
    padding: 30px 38px 70px;
}


/* =========================================================
   GENERAL
   ========================================================= */

.section-eyebrow {
    color: #a88a38;
    font-size: 1em;
    letter-spacing: 1.7px;
    font-weight: bold;
    margin-bottom: 9px;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.tourney-btn {
    height: 40px;
    padding: 0 18px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition:
        background .15s ease,
        border-color .15s ease,
        transform .1s ease;
}


.tourney-btn:active {
    transform: translateY(1px);
}


.tourney-btn.primary {
    border: 1px solid #ad3b22;
    background: #ad3b22;
    color: white;
}


.tourney-btn.primary:hover {
    background: #c1492b;
}


.tourney-btn.secondary {
    border: 1px solid #555;
    background: transparent;
    color: #ccc;
}


.tourney-btn.secondary:hover {
    border-color: #999;
    color: white;
}


.tourney-btn.danger {
    border: 1px solid #a52e2e;
    background: transparent;
    color: #ed7777;
}


.tourney-btn.danger:hover {
    background: #5c2020;
}


/* =========================================================
   TOURNAMENT TOOLBAR
   ========================================================= */

.tourney-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 28px;
    padding: 22px 25px;
    background: rgba(24,26,27,.9);
    border: 1px solid #363839;
    border-radius: 14px;
    box-shadow:
        0 15px 40px rgba(0,0,0,.3);
}


.setup-controls {
    display: flex;
    align-items: flex-end;
    gap: 16px;
}


.setup-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #8e8f90;
    font-size: 1.1em;
    font-weight: bold;
}


.setup-field input {
    width: 75px;
    height: 40px;
    padding: 0 10px;
    background: #101112;
    border: 1px solid #484b4c;
    border-radius: 6px;
    color: white;
    font-family: inherit;
    font-size: 15px;
}


.setup-field input:focus {
    outline: none;
    border-color: #b88d24;
}


.loading-wrapper {
    height: 40px;
    display: flex;
    align-items: center;
    padding: 0 15px;
}


.setup-warning {
    margin-top: 9px;
    color: #777;
    font-size: 1.1em;
}


.setup-note {
    margin-top: 9px;
    color: #777;
    font-size: 1.1em;
}


.new-tournament-wrapper {
    display: flex;    
    align-items: center;
}


.confirm-new-tournament {
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-top: 14px;
    border-top: 1px solid #353738;
    color: #aaa;
    font-size: 1.25em;
}


.confirm-actions {
    display: flex;
    gap: 8px;
}


/* =========================================================
   SHARE
   ========================================================= */

.share-section {
    min-width: 325px;
    display: flex;
    align-items: center;
    gap: 20px;
    padding-left: 28px;
    border-left: 1px solid #3a3c3d;
}


.share-title {
    color: #d1d0ca;
    font-size: 14px;
}


.game-code {
    margin-top: 5px;
    color: #e1b63d;
    font-family: Consolas, monospace;
    font-size: 17px;
    letter-spacing: 1.5px;
}


.qr-code {
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: white;
    border-radius: 8px;
}


/* =========================================================
   QR LOADED BAR
   ========================================================= */

.loaded-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 22px;
    background: rgba(24,26,27,.9);
    border: 1px solid #363839;
    border-radius: 12px;
}


.loaded-title {
    font-size: 17px;
    font-weight: bold;
}


.loaded-title span {
    margin-left: 5px;
    color: #d4a92e;
    font-family: Consolas, monospace;
    font-size: 14px;
}


.loaded-share {
    display: flex;
    align-items: center;
    gap: 13px;
}


.loaded-share .qr-code {
    width: 65px;
    height: 65px;
}


.share-small-label {
    color: #777;
    font-size: 9px;
    letter-spacing: 1.2px;
    font-weight: bold;
}


/* =========================================================
   PLAYER TOOLS
   ========================================================= */

.player-tools {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    margin: 24px 0;
}


.player-lookup,
.personal-round-counter {
    background: rgba(21,23,24,.88);
    border: 1px solid #343738;
    border-radius: 12px;
    padding: 18px 22px;
}


.lookup-row {
    display: flex;
    max-width: 500px;
}


.lookup-row input {
    flex: 1;
    height: 44px;
    padding: 0 13px;
    background: #101112;
    border: 1px solid #474a4b;
    border-right: 0;
    border-radius: 6px 0 0 6px;
    color: white;
    font-family: inherit;
    font-size: 14px;
}


.lookup-row input:focus {
    outline: none;
    border-color: #b88d24;
}


.search-button {
    width: 50px;
    border: 0;
    border-radius: 0 6px 6px 0;
    background: #ad3b22;
    color: white;
    cursor: pointer;
}


.search-button:hover {
    background: #c1492b;
}


.selected-player {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 9px;
    color: #aaa;
    font-size: 1.1em;
}


.selected-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #d0a72c;
}


/* =========================================================
   MY ROUND
   ========================================================= */

.personal-round-counter {
    border-color: #8f7021;
    text-align: center;
}


.personal-round-label {
    color: #d5a42d;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 1px;
}


.round-icon {
    margin-right: 7px;
}


.round-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 7px 0;
}


.round-button {
    width: 39px;
    height: 39px;
    border: 0;
    border-radius: 6px;
    background: #a94027;
    color: white;
    font-size: 25px;
    cursor: pointer;
}


.round-button:hover:not(:disabled) {
    background: #c1492b;
}


.round-button:disabled {
    opacity: .3;
    cursor: not-allowed;
}


.round-number {
    min-width: 48px;
    color: white;
    font-size: 30px;
    font-weight: bold;
}


.round-number small {
    display: block;
    margin-bottom: -2px;
    color: #777;
    font-size: .35em;
    letter-spacing: 1px;
}


.round-subtitle {
    color: #777;
    font-size: 1em;
}


.round-subtitle span {
    margin: 0 4px;
    color: #9c7e2d;
}


/* =========================================================
   WARNINGS
   ========================================================= */

.duplicate-warning {
    margin: 0 0 22px;
    padding: 11px 15px;
    background: rgba(105,45,45,.16);
    border-left: 3px solid #a85858;
    color: #c99a9a;
    font-size: 1.25em;
}


/* =========================================================
   YOU ARE HERE
   ========================================================= */

.current-game {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 28px;
    margin-bottom: 0;
    background: linear-gradient(110deg, #674c0f44, #1d1c19aa);
    border: 1px solid transparent;
    border-radius: 14px;
    transform: translateY(-8px);
    transition: max-height .45s ease, opacity .3s ease, padding .45s ease, margin-bottom .45s ease, transform .45s ease, border-color .45s ease;
}

    .current-game.current-visible {
        max-height: 300px;
        opacity: 1;
        padding: 24px 28px;
        margin-bottom: 32px;
        border-color: #8c6d1b;
        transform: translateY(0);
    }


.current-game-info h1 {
    margin: 0;
    font-size: 32px;
}


.current-game-info p {
    margin: 6px 0 0;
    color: #8d8d8d;
}


.current-matchup {
    min-width: 300px;
    padding: 14px 24px;
    background: rgba(0,0,0,.28);
    border: 1px solid #4b4b45;
    border-radius: 10px;
    text-align: center;
}


.table-badge {
    display: block;
    margin-bottom: 9px;
    color: #d3a72f;
    font-size: 1em;
    font-weight: bold;
    letter-spacing: 1.5px;
}


.matchup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-size: 21px;
}


.matchup span {
    color: #666;
    font-size: 9px;
    font-weight: bold;
    letter-spacing: 1px;
}


.bye-matchup {
    border-color: #6b5830;
}


.bye-text {
    color: #aaa;
    font-size: 15px;
}


.muted-matchup span {
    color: #666;
    font-size: 1.1em;
}


/* =========================================================
   SECTION HEADERS
   ========================================================= */

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 15px;
}


.section-heading h2 {
    margin: 0;
    color: #f0eee8;
    font-size: 27px;
}


.round-legend {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #777;
    font-size: 1.1em;
}


.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c19a2a;
    box-shadow: 0 0 8px rgba(193,154,42,.6);
}


/* =========================================================
   ROUND GRID
   ========================================================= */

.round-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 17px;
}


.round-card {
    min-height: 230px;
    background: rgba(19,20,21,.92);
    border: 1px solid #343637;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition:
        transform .15s ease,
        border-color .15s ease,
        box-shadow .15s ease;
}


.round-card:hover {
    transform: translateY(-2px);
    border-color: #74622d;
}


.round-card.current {
    border-color: #d0a82b;
    box-shadow:
        0 0 0 1px rgba(208,168,43,.12),
        0 10px 25px rgba(0,0,0,.25);
}


/* ROUND HEADER */

.round-card-header {
    position: relative;
    display: flex;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid #303233;
}


.round-title {
    display: flex;
    align-items: baseline;
    gap: 9px;
}


.round-title span {
    color: #777;
    font-size: 9px;
    font-weight: bold;   
    letter-spacing: 1.5px;
}


.round-title strong {
    color: #eee;
    font-size: 22px;
}


.round-card.current .round-title strong {
    color: #d5a72d;
}


.current-pill {
    position: absolute;
    top: 15px;
    right: 13px;
    padding: 4px 7px;
    background: #715d1e;
    border-radius: 4px;
    color: #e8c65e;
    font-size: 7px;
    font-weight: bold;
    letter-spacing: 1px;
}


/* TABLES */

.round-tables {
    padding: 5px 13px;
    display: flex;
    flex-wrap: wrap;
    gap: 2em;
    justify-content: center;
}


.round-table {
    padding: 1em;
    border: 1px solid #292b2c;
    border-radius: 7px;
}

.round-table.player-table {
    margin: 3px -1px;
    padding-left: 8px;
    padding-right: 8px;
    background: rgba(193,154,42,.07);
    border: 1px solid #8e7320;
    border-radius: 7px;
}


.table-title {
    margin-bottom: 8px;
    color: #9b7f2d;
    font-size: .75em;
    font-weight: bold;
    letter-spacing: 1.2px;
}


.table-matchup {
    display: grid;
    grid-template-columns: 1fr 27px 1fr;
    align-items: center;
    text-align: center;
    color: #e4e2dc;
    font-size: 16px;
    font-weight: bold;
}


.vs {
    color: #666;
    font-size: 8px;
    letter-spacing: .5px;
}


.bye-table {
    opacity: .8;
    flex-basis: 100%;
    margin-bottom: 1em;
}


.bye-players {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}


.bye-players span {
    padding: 4px 7px;
    background: #252526;
    border-radius: 4px;
    color: #aaa;
    font-size: 1.1em;
}


/* =========================================================
   PLAYER SUMMARIES
   ========================================================= */

.player-summary-section {
    margin-top: 50px;
}


.player-summary-grid {
    display: flex;
    flex-direction: column;
    gap: 13px;
}


.player-summary {
    padding: 15px 18px;
    background: rgba(18,19,20,.9);
    border: 1px solid #303233;
    border-radius: 10px;
}


.player-summary.selected-summary {
    border-color: #8f7021;
    box-shadow:
        0 0 0 1px rgba(143,112,33,.08);
}


.summary-player {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 13px;
}


.player-number {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #292a2b;
    color: #d4a82e;
    font-weight: bold;
}


.summary-player strong {
    display: block;
    color: #eee;
    font-size: 14px;
}


.summary-player span {
    display: block;
    margin-top: 2px;
    color: #666;
    font-size: 1em;
}


.summary-rounds {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(115px, 1fr)
    );
    gap: 7px;
}


.summary-round {
    min-height: 68px;
    padding: 8px;
    background: #111213;
    border: 1px solid #292a2b;
    border-radius: 6px;
}


.summary-round.active {
    border-color: #8f7021;
    background: rgba(193,154,42,.06);
}


.summary-round-header {
    display: flex;
    justify-content: space-between;
    color: #777;
    font-size: 8px;
    font-weight: bold;
    letter-spacing: .9px;
}


.summary-current {
    color: #d3a72f;
}


.summary-location {
    margin-top: 8px;
    color: #ddd;
    font-size: 1.25em;
    font-weight: bold;
}


.summary-location.bye {
    color: #a68d54;
}


.summary-partner {
    margin-top: 5px;
    color: #fff;
    font-size: 1em;
}


/* =========================================================
   RESUME DIALOG
   ========================================================= */

.resume-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;   
    justify-content: center;
    padding: 20px;
    background: rgba(0,0,0,.72);
}


.resume-dialog {
    width: min(450px, 100%);
    padding: 30px;
    background:
        linear-gradient(
            145deg,
            #202223,
            #111314
        );
    border: 1px solid #80691f;
    border-radius: 14px;
    text-align: center;
    box-shadow:
        0 25px 70px rgba(0,0,0,.6);
}


.resume-icon {
    margin-bottom: 8px;
    font-size: 30px;
}


.resume-dialog h2 {
    margin: 0;
    font-size: 25px;
}


.resume-dialog p {
    margin: 10px 0 23px;
    color: #888;
    line-height: 1.5;
}


.resume-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {
    .tourney-toolbar {
        grid-template-columns: 1fr;
    }

    .share-section {
        padding: 18px 0 0;
        border-top: 1px solid #3a3c3d;
        border-left: 0;
    }


    .round-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


@media (max-width: 750px) {

    .tourney-content {
        padding: 18px 14px 50px;
    }


    .player-tools {
        grid-template-columns: 1fr;
    }


    .current-game {
        flex-direction: column;
        align-items: stretch;
    }


    .current-matchup {
        min-width: 0;
    }


    .round-grid {
        display: flex;
        overflow-x: auto;
        gap: 13px;
        padding: 12px;
        scroll-snap-type: x mandatory;
        scroll-snap-align: center;
    }


    .round-card {
        flex: 0 0 285px;
        scroll-snap-align: start;
    }


    .setup-controls {
        flex-wrap: wrap;
    }


    .confirm-new-tournament {
        align-items: flex-start;
        flex-direction: column;
    }


    .loaded-toolbar {
        align-items: center;
        flex-direction: column;
        gap: 15px;
    }


    .summary-rounds {
        grid-template-columns: repeat(2, 1fr);
    }
}

.fade-on-disable:disabled{
    opacity:.5;
}

@media (max-width: 450px) {

    .share-section {
        align-items: flex-start;
        flex-direction: column;
    }


    .summary-rounds {
        grid-template-columns: 1fr 1fr;
    }
}