/* ==========================================================================
   1. BAASSTIILID & MUUTUJAD
   ========================================================================== */
:root {
    --primary: #2563eb;
    --success: #10b981;
    --bg: #f8fafc;
    --text: #0f172a;
    --dark-text: #1e293b;
    --gray-500: #64748b;
    --gray-400: #94a3b8;
    --gray-300: #cbd5e1;
    --gray-200: #e2e8f0;
    --gray-100: #f1f5f9;
    --blue-900: #1e40af;
    --blue-200: #bfdbfe;
    --blue-100: #eff6ff;
    --yellow-200: #fef3c7;
    --yellow-100: #fffbeb;
    --green-500: #059669;
    --green-300: #a7f3d0;
    --green-100: #ecfdf5;
    --red-400: #f87171;
    --red-100: #fee2e2;
    --red-50: #fef2f2;
}

body {
    font-family:
        monospace,
        -apple-system,
        sans-serif;
    background: var(--bg);
    padding: 16px;
    padding-bottom: 60px;
    margin: 0;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

.container {
    max-width: 600px;
    margin: 30px auto;
    padding: 0 15px;
}

.d-none {
    display: none !important;
}

/* ==========================================================================
   2. STRUKTUUR & KAARDID (CARDS)
   ========================================================================== */
.card {
    background: #fff;
    padding: 24px;
    border-radius: 28px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.card-center {
    text-align: center;
}

.card-small {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--gray-200);
    width: 100%;
    gap: 12px;
}

h2 {
    margin: 0 0 25px 0;
    font-size: 22px;
    font-weight: 800;
    text-align: center;
}

h3 {
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--gray-500);
    text-transform: uppercase;
}

/* ==========================================================================
   3. VORMI ELEMENDID & SEADISTUSED (SETTINGS)
   ========================================================================== */
.setting-row {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 15px !important;
    min-height: 55px;
    box-sizing: border-box;
}

.setting-label-group {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px;
    text-align: left;
    white-space: nowrap;
}

.setting-label-group .info-i {
    cursor: pointer;
    width: 20px;
    min-width: 20px;
    height: 20px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

.setting-label-group .info-placeholder {
    visibility: hidden;
}

.setting-clickable-label {
    cursor: pointer;
    margin: 0;
    font-weight: inherit;
}

.setting-checkbox-wrapper {
    padding-right: 5px;
    display: flex !important;
    align-items: center;
}

.setting-checkbox-wrapper input[type="checkbox"] {
    transform: scale(2);
    cursor: pointer;
    margin: 0;
}

#max_p_setting {
    transition: all 0.3s ease-in-out;
    max-height: 100px;
    opacity: 1;
    overflow: hidden;
}

#max_p_setting.d-none {
    max-height: 0 !important;
    opacity: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    min-height: 0 !important;
    border: none !important;
}

.stepper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gray-100);
    padding: 4px;
    border-radius: 16px;
}

.stepper button {
    background: #fff;
    border: none;
    border-radius: 12px;
    width: 38px;
    height: 38px;
    font-weight: bold;
    cursor: pointer;
    color: var(--primary);
    font-size: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stepper input {
    border: none;
    background: transparent;
    width: 35px;
    text-align: center;
    font-weight: 800;
    font-size: 16px;
    pointer-events: none;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    font-size: 14px;
    margin-bottom: 5px;
    color: var(--gray-500);
}

.form-label-dark {
    display: block;
    font-size: 14px;
    margin-bottom: 5px;
    color: var(--dark-text);
}

.form-control {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    font-weight: bold;
    font-size: 15px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
}

.form-control-lg {
    width: 100%;
    padding: 12px;
    box-sizing: border-box;
    font-weight: 900;
    font-size: 18px;
    text-align: center;
    letter-spacing: 3px;
    text-transform: uppercase;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
}

.form-control-sm {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-flex-1 {
    flex: 1;
    padding: 5px 0px;
}
.form-flex-2 {
    flex: 2;
    padding: 5px 0px;
}

.auth-form-group {
    margin-bottom: 15px;
}

/* ==========================================================================
   4. NUPUD (BUTTONS)
   ========================================================================== */
.btn {
    background: var(--success);
    color: #fff;
    border: none;
    padding: 18px;
    width: 100%;
    border-radius: 20px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--green-500);
    transition: all 0.1s;
    display: block;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}

.btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--green-500);
}

.btn-blue {
    background: var(--primary);
    box-shadow: 0 4px 0 var(--blue-700);
}

.btn-blue:active {
    box-shadow: 0 2px 0 var(--blue-700);
}

.btn-secondary {
    background: var(--gray-500);
    box-shadow: 0 4px 0 #475569;
}

.btn-secondary:active {
    box-shadow: 0 2px 0 #475569;
}

.btn-block {
    width: 100%;
}
.btn-block-sm {
    width: 100%;
    padding: 12px;
}

.btn-add-manual-player {
    background: var(--primary);
    width: auto;
    padding: 10px 16px;
    margin: 0;
    font-size: 14px;
    box-shadow: none;
}

.btn-edit-round {
    background: var(--gray-500);
    font-size: 12px;
}

.btn-new-tournament {
    display: block;
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background: var(--gray-100);
    color: var(--red-400) !important;
    font-weight: 800;
    text-decoration: none;
    border-radius: 12px;
    border: 2px solid var(--red-100);
    text-transform: uppercase;
}

.btn-google-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: white;
    color: var(--dark-text);
    border: 1px solid var(--gray-300);
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.btn-remove-player {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    padding: 0 5px;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
}

.type-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.type-btn {
    flex: 1;
    padding: 12px;
    border-radius: 14px;
    border: 2px solid var(--gray-100);
    background: #fff;
    cursor: pointer;
    font-weight: 700;
    color: var(--gray-500);
    transition: all 0.2s;
}

.type-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--blue-100);
}

.install-banner {
    display: none;
    background: var(--primary);
    color: white;
    padding: 15px;
    text-align: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
}

.install-button {
    background: white;
    color: var(--primary);
    border: none;
    padding: 5px 15px;
    border-radius: 5px;
    font-weight: bold;
    margin-left: 10px;
}

/* ==========================================================================
   5. MÄNGUD, MATŠID & SKOORID (MATCHES)
   ========================================================================== */
.match {
    background: #f8fafc;
    padding: 20px;
    border-radius: 24px;
    margin-bottom: 15px;
    border: 1px solid #f1f5f9;
}

.match-center {
    text-align: center;
}

.score-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.score-team-col {
    flex: 1;
    text-align: center;
}

.team-names {
    font-size: 13px;
    font-weight: 800;
    min-height: 35px;
}

.vs-divider {
    font-weight: 900;
    color: var(--gray-300);
    margin-top: 30px;
}

.score-input {
    width: 85px;
    text-align: center;
    font-size: 32px !important;
    font-weight: 900;
    border: 2px solid var(--gray-200);
    border-radius: 18px;
    padding: 10px 0;
    background: #fff;
}

.info-i {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 15px;
    line-height: 20px;
    cursor: pointer;
    margin-left: 5px;
    font-style: normal;
    font-weight: bold;
    vertical-align: middle;
}

.match-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 12px;
    text-transform: uppercase;
    display: inline-block;
    text-align: center;
}

.match-badge-win {
    background: #dcfce7;
    color: #15803d;
}
.match-badge-draw {
    background: #fef3c7;
    color: #92400e;
}
.match-badge-loss {
    background: #fee2e2;
    color: #b91c1c;
}

/* ==========================================================================
   6. TABELID (TABLES)
   ========================================================================== */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

thead tr {
    font-size: 11px;
    color: var(--gray-500);
    text-transform: uppercase;
}

table th {
    padding: 0 15px 10px 15px;
    letter-spacing: 0.05em;
}

table th.text-left {
    text-align: left;
}
table th.text-right {
    text-align: right;
}

table td {
    padding: 18px 15px;
    background: #fff;
    border-bottom: 1px solid var(--gray-100);
    text-align: center;
}

.rank-cell {
    border-radius: 18px 0 0 18px;
    font-weight: 800;
    color: var(--gray-500);
    width: 30px;
}

.name-cell {
    font-weight: 700;
    text-align: left;
}

.total-score-cell {
    color: var(--primary);
    font-weight: 900;
    font-size: 18px;
}

.diff-score-cell {
    text-align: right;
    font-size: 14px;
    font-weight: 700;
}

.diff-positive {
    color: var(--success);
}
.diff-negative {
    color: var(--red-400);
}

/* ==========================================================================
   7. TEATED, HOIATUSED & LOGID (NOTICES)
   ========================================================================== */
.notice {
    background: var(--green-100);
    color: #065f46;
    padding: 20px;
    border-radius: 24px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid var(--green-300);
    font-weight: 800;
}

.waiting {
    background: var(--yellow-100);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid var(--yellow-200);
    font-size: 14px;
    color: #92400e;
}

.message-error {
    color: #f87171;
    background: #fef2f2;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 14px;
}

.message-success {
    color: var(--success);
    background: var(--green-100);
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 600;
}

/* ==========================================================================
   8. ESIVEEB & PEALKIRJA ADMIN-GRUPP (HEADER)
   ========================================================================== */
.header-user-group {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    justify-content: flex-end;
}

.header-username-link {
    font-size: 14px;
    color: var(--dark-text);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.header-username-link a {
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    margin-left: 3px;
}

.btn-logout-icon {
    display: inline-flex;
    align-items: center;
    color: #ef4444;
    text-decoration: none;
    flex-shrink: 0;
}

.btn-login-icon {
    display: inline-flex;
    align-items: center;
    color: var(--dark-text);
    text-decoration: none;
}

.header-lang-wrapper {
    margin: 10px 0;
    text-align: right;
}

.header-lang-wrapper select {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--gray-300);
    background: #fff;
    color: #334155;
    cursor: pointer;
    outline: none;
}

.btn-join-header {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    padding: 10px 18px;
    background: var(--primary);
    color: white;
    width: auto;
    margin: 0;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: none;
    white-space: nowrap;
}

h2 .room-code-display {
    font-size: 20px;
    padding: 4px 12px;
    vertical-align: middle;
    margin-left: 5px;
}

/* ==========================================================================
   9. OOTERUUM & DRAG-AND-DROP (LOBBY)
   ========================================================================== */
.lobby-info-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap; /* Lubab elementidel mobiilis üksteise alla kukkuda */
    gap: 20px;
    margin-bottom: 25px;
    background: var(--gray-100);
    padding: 24px;
    border-radius: 28px;
    box-sizing: border-box;
    text-align: center;
}

.lobby-info-column {
    flex: 1;
    min-width: 220px;
    text-align: center;
}

.or-divider {
    color: var(--gray-400);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    user-select: none;
    text-align: center;
    width: 100%;
    margin: 5px 0;
}

.lobby-text {
    font-size: 14px;
    color: var(--gray-500);
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.room-code-display {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 4px;
    color: var(--primary);
    background: white;
    display: inline-block;
    padding: 8px 24px;
    border-radius: 8px;
    border: 1px solid var(--gray-300);
    font-family: monospace;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.qrcode-wrapper {
    display: inline-block;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--gray-300);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.lobby-sort-instruction {
    font-size: 12px;
    color: var(--gray-400);
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
}

.lobby-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.lobby-player-row {
    display: flex;
    align-items: center;
    background: var(--gray-100);
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
    touch-action: none;
    user-select: none;
    cursor: grab;
}

.lobby-player-row:active {
    cursor: grabbing;
    background: #f8fafc;
}

.lobby-player-name-input {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 15px;
    font-weight: 700;
    color: var(--dark-text);
    padding: 2px 0;
    pointer-events: none;
}

.lobby-player-rating {
    font-size: 11px;
    background: var(--gray-200);
    color: #475569;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    font-family: monospace;
    white-space: nowrap;
    margin-left: 6px;
    user-select: none;
}

.drag-handle {
    display: inline-block;
    width: 3px;
    height: 14px;
    margin-right: 12px;
    margin-left: 4px;
    opacity: 0.25;
    flex-shrink: 0;
    border-left: 2px dotted #000;
    border-right: 2px dotted #000;
}

.dragging {
    opacity: 0.5;
    background: var(--blue-100) !important;
}

.manual-add-player {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
}

.manual-player-input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
}

/* ==========================================================================
   10. MÄNGIJA LIVE-VAADE & KÜLALISE OOTERUUM (LIVE VIEW)
   ========================================================================== */
.live-player-info-card {
    padding: 15px;
    margin-bottom: 15px;
    background: var(--gray-100);
    border-radius: 16px;
}

.live-player-info-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.live-player-name {
    font-weight: 800;
    color: var(--dark-text);
}

.live-room-code-badge {
    font-family: monospace;
    font-weight: 900;
    color: var(--primary);
    background: white;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
}

.live-connecting-text {
    color: var(--gray-500);
    margin: 0;
}

.lobby-waiting-text {
    text-align: center;
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 20px;
}

.lobby-scroll-list {
    max-height: 300px;
    overflow-y: auto;
}

.lobby-player-item {
    padding: 10px 14px;
    margin-bottom: 8px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    font-weight: 600;
    background: white;
    box-sizing: border-box;
}

.lobby-player-item.is-me {
    border: 2px solid var(--primary);
    background: var(--blue-100);
}

.lobby-me-badge {
    font-size: 11px;
    background: var(--primary);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    float: right;
    text-transform: uppercase;
}

.live-round-badge {
    text-align: center;
    margin-bottom: 15px;
    background: var(--primary);
    color: white;
    padding: 8px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 14px;
}

.text-live-primary {
    color: var(--primary);
}
.text-live-warning {
    color: #ea580c;
    text-align: center;
    margin-bottom: 15px;
}
.text-live-success {
    color: #16a34a;
    font-weight: 700;
    font-size: 14px;
}

.live-vs-divider {
    margin: 10px 0;
    font-weight: 900;
    color: var(--gray-400);
    font-size: 12px;
}

.live-big-score {
    font-size: 36px;
    font-weight: 900;
    color: #16a34a;
    margin-top: 5px;
}

.live-info-p {
    text-align: center;
    margin-top: 15px;
    font-size: 13px;
    color: var(--gray-500);
}
.live-success-p {
    font-size: 13px;
    color: #14532d;
    margin-top: 10px;
    margin-bottom: 0;
}
.live-skip-p {
    text-align: center;
    color: var(--gray-500);
    line-height: 1.5;
    margin-bottom: 20px;
}
.text-live-error {
    color: #ef4444;
    margin: 0;
}

.live-leaderboard-title {
    border-top: 1px solid var(--gray-200);
    padding-top: 20px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--gray-500);
    text-transform: uppercase;
}

.live-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.live-table tr {
    border-bottom: 1px solid var(--gray-100);
}
.live-table tr.is-me {
    font-weight: bold;
    background: var(--blue-100);
}
.live-table td {
    padding: 8px 4px;
    background: transparent;
    border-bottom: none;
}
.live-cell-rank {
    color: var(--gray-500);
    width: 30px;
}
.live-cell-name {
    text-align: left;
}
.live-cell-total {
    text-align: center;
    font-weight: 700;
}
.live-cell-diff {
    text-align: right;
    font-size: 12px;
    font-weight: 600;
}

.final-winner-banner {
    text-align: center;
    background: #fef3c7;
    border: 1px solid #fde68a;
    margin-bottom: 15px;
    border-radius: 16px;
    padding: 15px;
}

.final-winner-banner b {
    color: #92400e;
    font-size: 16px;
}

.final-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.final-table thead tr {
    border-bottom: 2px solid var(--gray-200);
}
.final-table th {
    text-align: left;
    padding-bottom: 8px;
}
.final-table th.text-center {
    text-align: center;
}
.final-table th.text-right {
    text-align: right;
}
.final-table tr {
    border-bottom: 1px solid var(--gray-200);
}
.final-table tr.is-me {
    background: var(--blue-100);
    font-weight: 800;
    border: 1px solid var(--blue-200);
}
.final-table td {
    padding: 12px 6px;
    background: transparent;
}
.final-cell-position {
    font-weight: 700;
    color: #475569;
}
.final-cell-name {
    text-align: left;
}
.final-cell-points {
    text-align: center;
    font-weight: 900;
    color: var(--primary);
}
.final-cell-diff {
    text-align: right;
    font-weight: 700;
}

.alert-started-container {
    text-align: center;
    margin-top: 25px;
    padding: 15px;
    background: #fff7ed;
    border: 1px solid #ffedd5;
    border-radius: 12px;
    box-sizing: border-box;
}

.alert-started-title {
    color: #ea580c;
    margin-bottom: 8px;
    font-weight: 800;
}
.alert-started-text {
    font-size: 13px;
    color: #9a3412;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* ==========================================================================
   11. PROFIIL & AJALUGU (USER PROFILE)
   ========================================================================== */
.profile-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.profile-header-actions .lang-dropdown-wrapper {
    text-align: right;
    margin-top: -20px;
}

.profile-header-actions select {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--gray-300);
    background: #fff;
    color: #334155;
    cursor: pointer;
    outline: none;
    display: block;
}

.profile-name-title {
    margin: 0;
    color: var(--dark-text);
    font-size: 22px;
    font-weight: 800;
}

.profile-rating-badge {
    font-size: 13px;
    background: var(--gray-200);
    color: #475569;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-family: monospace;
    user-select: none;
    vertical-align: middle;
}

.card-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.stats-box {
    flex: 1;
    min-width: 45%;
    background: var(--bg);
    border: 1px solid var(--gray-200);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

.stats-box-label {
    font-size: 11px;
    color: var(--gray-500);
    font-weight: bold;
}
.stats-box-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--dark-text);
    margin-top: 2px;
}
.stats-value-green {
    color: var(--success);
}
.stats-value-blue {
    color: var(--primary);
}
.stats-value-red {
    color: var(--red-400);
}

.chart-container {
    width: 100%;
    height: 180px;
    position: relative;
}
.history-empty-text {
    text-align: center;
    color: var(--gray-400);
    font-size: 13px;
    padding: 20px 0;
}
.history-nav-row {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    gap: 10px;
    margin-bottom: 15px;
}

.history-nav-row .type-btn {
    flex: 1;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    padding: 6px;
    font-size: 12px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

.nav-btn-hidden {
    visibility: hidden;
}
.tournament-block {
    margin-bottom: 10px;
}
.tournament-block-header {
    font-weight: 700;
    color: var(--dark-text);
    font-size: 14px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tournament-block-date {
    color: var(--gray-500);
    font-size: 12px;
    font-weight: normal;
}
.history-score-win {
    color: var(--dark-text);
    font-weight: 800;
}
.history-score-lose {
    color: var(--gray-500);
    font-weight: normal;
}

.match-history-row {
    padding: 6px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.match-history-info {
    flex: 1;
    padding-right: 10px;
}
.match-history-my-team {
    font-weight: 600;
    color: #334155;
}
.match-history-my-team .match-badge {
    font-size: 9px;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 3px;
}
.match-history-opp-team {
    font-size: 11px;
    color: var(--gray-400);
}
.match-history-score {
    font-size: 14px;
    font-weight: bold;
    font-family: monospace;
    white-space: nowrap;
}

/* ==========================================================================
   12. KASUTUSJUHEND, JALUS & MEEDIA PÄRINGUD (FOOTER & EXTRA)
   ========================================================================== */
.guide-container {
    max-width: 500px;
    margin: 20px auto;
}
.guide-card {
    padding: 20px;
}
.guide-content {
    color: #334155;
    line-height: 1.6;
    font-size: 15px;
}
.guide-section-title {
    color: var(--primary);
    margin-top: 20px;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 700;
}
.guide-list {
    padding-left: 20px;
    margin: 0 0 15px 0;
}
.guide-list li {
    margin-bottom: 6px;
}
.guide-code {
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
    color: var(--text);
}
#tournament_render_area {
    padding-top: 15px;
}

.site-footer {
    text-align: center;
    margin-top: 30px;
    font-size: 13px;
    color: var(--gray-500);
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: center;
}

.site-footer a {
    color: var(--gray-500);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.1s;
}
.site-footer a:hover {
    color: var(--primary);
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
}
.link-primary-bold {
    color: var(--primary);
    font-size: 13px;
    text-decoration: none;
    font-weight: 600;
}
.link-secondary {
    color: var(--gray-500);
    font-size: 13px;
    text-decoration: none;
}
.divider-text {
    text-align: center;
    margin: 15px 0;
    color: var(--gray-500);
    font-size: 14px;
}
.icon-block {
    display: block;
}

@media (min-width: 530px) {
    .lobby-info-container {
        flex-wrap: nowrap; /* Keelab arvutis üksteise alla kukkumise */
        justify-content: space-between;
        padding: 20px 30px;
    }

    .lobby-info-column {
        width: auto;
        flex: 1;
    }

    .or-divider {
        width: auto;
        margin: 0 20px;
        flex-shrink: 0;
    }
}
