/* Plinko Name Picker - Styles */

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

body {
    font-family: system-ui, -apple-system, sans-serif;
    background: #1a1a2e;
    color: #ffffff;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
header {
    background: #16213e;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #e94560;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
}

.settings-btn {
    background: transparent;
    border: none;
    color: #b8b8b8;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}

.settings-btn:hover {
    color: #e94560;
}

/* Main Layout */
main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Canvas Area */
.canvas-container {
    flex: 7;
    background: #1a1a2e;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    min-width: 0;
}

#plinko-canvas {
    background: #0f0f1a;
    border-radius: 8px;
}

/* Countdown Overlay */
.countdown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.countdown-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.countdown-text {
    font-size: 6rem;
    font-weight: bold;
    color: #e94560;
    text-shadow: 0 0 30px rgba(233, 69, 96, 0.5);
}

/* Sidebars */
.sidebar-left,
.sidebar-right {
    background: #2d2d44;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
}

.sidebar-left {
    min-width: 160px;
    max-width: 200px;
}

.sidebar-right {
    min-width: 280px;
    max-width: 350px;
}

/* Players List (left sidebar) */
.players-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.players-list li {
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.players-list li.picked {
    opacity: 0.4;
    text-decoration: line-through;
}

.no-players {
    color: #6b6b8a;
    font-style: italic;
    text-align: center;
    padding: 10px 0;
    background: transparent !important;
}

.sidebar-section {
    background: #3d3d5c;
    border-radius: 8px;
    padding: 15px;
    transition: padding 0.3s ease;
}

.sidebar-section h2 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #b8b8b8;
    margin-bottom: 12px;
    transition: margin 0.3s ease;
}

/* Collapsible sections */
.sidebar-section.collapsible .section-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 500px;
    opacity: 1;
}

.sidebar-section.collapsible.collapsed {
    padding: 10px 15px;
}

.sidebar-section.collapsible.collapsed h2 {
    margin-bottom: 0;
}

.sidebar-section.collapsible.collapsed .section-content {
    max-height: 0;
    opacity: 0;
}

/* Mode Selector */
.mode-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.mode-btn {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #4d4d6a;
    border-radius: 6px;
    background: transparent;
    color: #b8b8b8;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-btn:hover {
    border-color: #e94560;
    color: #ffffff;
}

.mode-btn.active {
    border-color: #e94560;
    background: #e94560;
    color: #ffffff;
}

/* Team Options */
.team-options {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #4d4d6a;
}

.team-options label {
    font-size: 0.9rem;
    color: #b8b8b8;
}

.team-count-input {
    width: 60px;
    padding: 8px 10px;
    background: #1a1a2e;
    border: 1px solid #4d4d6a;
    border-radius: 6px;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    text-align: center;
}

.team-count-input:focus {
    outline: none;
    border-color: #e94560;
}

/* Class List */
.class-list-textarea {
    width: 100%;
    height: 200px;
    background: #1a1a2e;
    border: 1px solid #4d4d6a;
    border-radius: 6px;
    color: #ffffff;
    padding: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    line-height: 1.5;
}

.class-list-textarea:focus {
    outline: none;
    border-color: #e94560;
}

.class-list-textarea::placeholder {
    color: #6b6b8a;
}

/* Buttons */
.button-row {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #e94560;
    color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
    background: #d63850;
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: #5a3040;
    color: #8a6070;
    cursor: not-allowed;
}

.btn-secondary {
    background: #4d4d6a;
    color: #ffffff;
}

.btn-secondary:hover:not(:disabled) {
    background: #5d5d7a;
}

.btn-secondary:disabled {
    background: #3d3d5a;
    color: #6b6b8a;
    cursor: not-allowed;
}

/* Results */
.results-list {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

.results-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #4d4d6a;
}

.results-list li:last-child {
    border-bottom: none;
}

.result-position {
    font-weight: 600;
    color: #b8b8b8;
    min-width: 24px;
}

.result-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.result-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.no-results {
    color: #6b6b8a;
    font-style: italic;
    text-align: center;
    padding: 20px 0;
}

/* Team Results */
.team-result {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #4d4d6a;
}

.team-result:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.team-header {
    font-weight: 600;
    font-size: 0.95rem;
    color: #e94560;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-members {
    list-style: none;
    padding-left: 12px;
}

.team-members li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 0.9rem;
}

.member-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.team-waiting {
    color: #6b6b8a;
    font-style: italic;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 900px) {
    main {
        flex-direction: column;
    }

    .sidebar-left {
        display: none;
    }

    .canvas-container {
        flex: none;
        height: 50vh;
    }

    .sidebar-right {
        max-width: none;
        flex: 1;
    }
}
