/* Sumo Pachinko - Sumostats-inspired Dark Theme */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0b;
    color: #ededef;
    min-height: 100vh;
    overflow: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 20px;
}

/* Top Bar */
.top-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: rgba(28, 28, 30, 0.7);
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 10px;
    border: 1px solid #2a2a2d;
}

.top-bar h1 {
    font-size: 16px;
    color: #12a594;
    text-shadow: 0 0 10px rgba(18, 165, 148, 0.3);
    white-space: nowrap;
}

.powered-by {
    font-size: 0.7rem;
    color: #6e6e76;
    white-space: nowrap;
}

.powered-by a {
    color: #12a594;
    text-decoration: none;
}

.powered-by a:hover {
    text-decoration: underline;
}

.top-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.top-controls select {
    width: auto;
    padding: 6px 10px;
    font-size: 0.8rem;
}

.top-controls .btn {
    flex: none;
    padding: 6px 12px;
    font-size: 0.8rem;
}

.speed-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #6e6e76;
    white-space: nowrap;
}

.speed-label span {
    color: #12a594;
    font-weight: 600;
}

.speed-label input[type="range"] {
    width: 80px;
}

.top-controls #status {
    font-size: 0.8rem;
    color: #6e6e76;
    margin-left: auto;
    white-space: nowrap;
}

/* Main Layout */
.game-layout {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* Game Area */
.game-area {
    flex: 1;
    min-width: 0;
}

#game-container {
    background: #111113;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    border: 1px solid #2a2a2d;
}

#game-container canvas {
    display: block;
}

/* Banzuke Panel */
.banzuke-panel {
    width: 260px;
    flex-shrink: 0;
    background: rgba(28, 28, 30, 0.7);
    border-radius: 10px;
    padding: 12px;
    border: 1px solid #2a2a2d;
    overflow-y: auto;
    max-height: calc(100vh - 80px);
}

.banzuke-panel h3 {
    color: #12a594;
    font-size: 0.9rem;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #2a2a2d;
}

.btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #12a594, #0d9b8a);
    color: white;
}

.btn-secondary {
    background: rgba(28, 28, 30, 0.8);
    color: #ededef;
    border: 1px solid #2a2a2d;
}

.btn-warning {
    background: linear-gradient(135deg, #ffb224, #e5a00d);
    color: #111113;
}

/* Select */
select {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #2a2a2d;
    background: #1c1c1e;
    color: #ededef;
    font-size: 0.85rem;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: #12a594;
}

/* Range Slider */
input[type="range"] {
    height: 6px;
    border-radius: 3px;
    background: #2a2a2d;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #12a594;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(18, 165, 148, 0.4);
}

/* Banzuke Table */
.banzuke-table {
    display: flex;
    flex-direction: column;
}

.bz-separator {
    font-size: 10px;
    font-weight: 600;
    color: #6e6e76;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 6px 2px;
    border-bottom: 1px solid #2a2a2d;
    margin-top: 4px;
}

.bz-row {
    display: flex;
    align-items: center;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
}

.bz-east, .bz-west {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bz-east {
    text-align: right;
    padding-right: 6px;
}

.bz-west {
    text-align: left;
    padding-left: 6px;
}

.bz-rank {
    width: 32px;
    text-align: center;
    font-weight: 700;
    flex-shrink: 0;
}

.bz-empty {
    color: #3a3a3d;
}

/* Banzuke tier row backgrounds */
.bz-row.tier-yokozuna { background: rgba(255, 178, 36, 0.10); }
.bz-row.tier-ozeki { background: rgba(229, 72, 77, 0.10); }
.bz-row.tier-sekiwake { background: rgba(62, 99, 221, 0.10); }
.bz-row.tier-komusubi { background: rgba(142, 78, 198, 0.10); }
.bz-row.tier-maegashira { background: rgba(134, 142, 150, 0.05); }

/* Banzuke rank label colors */
.bz-rank.rank-yokozuna { color: #ffb224; }
.bz-rank.rank-ozeki { color: #e5484d; }
.bz-rank.rank-sekiwake { color: #3e63dd; }
.bz-rank.rank-komusubi { color: #8e4ec6; }
.bz-rank.rank-maegashira { color: #868e96; }

/* Prediction highlights */
.bz-prediction {
    font-weight: 700;
}

.bz-filled {
    transition: background-color 0.3s ease;
    background: rgba(18, 165, 148, 0.08);
}

/* Ball Tooltip */
.ball-tooltip {
    display: none;
    position: fixed;
    z-index: 1000;
    pointer-events: none;
    background: #1c1c1e;
    border: 1px solid #2a2a2d;
    border-radius: 8px;
    padding: 10px 12px;
    min-width: 180px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    font-size: 0.8rem;
    color: #ededef;
}

.tt-name {
    font-size: 0.95rem;
    font-weight: 700;
    padding-left: 8px;
    margin-bottom: 8px;
}

.tt-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    gap: 12px;
}

.tt-label {
    color: #6e6e76;
    flex-shrink: 0;
}

.tt-val {
    text-align: right;
    color: #ededef;
}

.tt-up {
    color: #30a46c;
}

.tt-down {
    color: #e5484d;
}

.tt-same {
    color: #6e6e76;
}

.tt-divider {
    height: 1px;
    background: #2a2a2d;
    margin: 6px 0;
}

.tt-badge {
    margin-top: 6px;
    padding: 2px 8px;
    background: rgba(18, 165, 148, 0.15);
    color: #12a594;
    border-radius: 4px;
    font-size: 0.75rem;
    text-align: center;
    font-weight: 600;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #111113;
}

::-webkit-scrollbar-thumb {
    background: #2a2a2d;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #12a594;
}

/* Responsive */
@media (max-width: 1200px) {
    .game-layout {
        flex-direction: column;
    }

    .game-area {
        min-width: auto;
    }

    .banzuke-panel {
        width: 100%;
        max-height: 300px;
    }
}
