* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a1a;
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    padding-top: 60px;
}

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #242424;
    border-bottom: 1px solid #333;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 100;
}

.nav-link {
    color: #888;
    text-decoration: none;
    font-size: 0.9em;
}

.nav-link:hover {
    color: #3b82f6;
}

.version {
    margin-left: auto;
    color: #555;
    font-size: 0.8em;
}

.container {
    background: #242424;
    border-radius: 8px;
    padding: 32px;
    max-width: 500px;
    width: 100%;
    border: 1px solid #333;
}

h1 {
    color: #fff;
    text-align: center;
    margin-bottom: 8px;
    font-size: 1.75em;
    font-weight: 600;
}

.subtitle {
    text-align: center;
    color: #888;
    margin-bottom: 24px;
    font-size: 0.9em;
}

.rotating-word {
    display: inline-block;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.rotating-word.fade-out {
    opacity: 0;
    transform: translateY(-8px);
}

.rotating-word.fade-in {
    opacity: 0;
    transform: translateY(8px);
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

label {
    display: block;
    margin-bottom: 6px;
    color: #ccc;
    font-weight: 500;
    font-size: 0.9em;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 10px 12px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 15px;
    color: #e0e0e0;
    margin-bottom: 16px;
}

input:focus,
select:focus {
    outline: none;
    border-color: #666;
}

button {
    width: 100%;
    padding: 12px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

button:hover {
    background: #2563eb;
}

button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-secondary {
    background: #333;
    color: #e0e0e0;
    margin-top: 8px;
}

.btn-secondary:hover {
    background: #444;
}

.panel {
    background: #1a1a1a;
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    border: 1px solid #333;
}

.panel h3 {
    color: #fff;
    margin-bottom: 12px;
    font-size: 0.95em;
    font-weight: 600;
}

.panel p {
    color: #888;
    font-size: 0.9em;
    line-height: 1.5;
}

.room-code-display {
    font-size: 2em;
    font-weight: 700;
    color: #3b82f6;
    letter-spacing: 4px;
    margin: 8px 0;
    cursor: pointer;
    text-align: center;
}

.room-code-hint {
    color: #666;
    font-size: 0.85em;
    text-align: center;
}

.player-item {
    background: #242424;
    padding: 10px 12px;
    border-radius: 4px;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-name {
    font-weight: 500;
    color: #e0e0e0;
}

.host-badge {
    background: #3b82f6;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight: 500;
}

.wins-badge {
    background: #10b981;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight: 500;
    margin-left: auto;
    margin-right: 8px;
}

.reveal-card {
    background: #2a2a2a;
    color: #e0e0e0;
    padding: 32px;
    border-radius: 6px;
    text-align: center;
    margin-bottom: 16px;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px solid #333;
}

.reveal-card.spy {
    border-color: #dc2626;
    background: #2a1a1a;
}

.reveal-card.opinion {
    border-color: #3b82f6;
}

.reveal-card.hidden {
    border-color: #444;
}

.reveal-card h2 {
    font-size: 1.25em;
    margin-bottom: 12px;
    font-weight: 500;
}

.opinion-text {
    font-size: 1.2em;
    font-weight: 500;
    padding: 16px;
    background: #1a1a1a;
    border-radius: 4px;
}

.spy-text {
    font-size: 1.5em;
    font-weight: 700;
    color: #dc2626;
}

.status-message {
    background: #332b00;
    color: #fbbf24;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 16px;
    text-align: center;
    font-size: 0.9em;
    border: 1px solid #4a3f00;
}

.connection-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    cursor: default;
}

.connection-indicator.connected {
    background: #1a2e1a;
    color: #4ade80;
    border: 1px solid #2d4a2d;
}

.connection-indicator.disconnected {
    background: #2e1a1a;
    color: #f87171;
    border: 1px solid #4a2d2d;
    cursor: pointer;
}

.connection-indicator.connecting {
    background: #2e2a1a;
    color: #fbbf24;
    border: 1px solid #4a3f2d;
}

.checkbox-option {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.checkbox-option input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    margin-bottom: 0;
}

.checkbox-option label {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: normal;
    font-size: 0.9em;
}

.setting-row {
    margin-bottom: 12px;
}

.setting-row label {
    display: inline;
    margin-right: 8px;
}

.setting-row select {
    width: auto;
    display: inline-block;
    margin-bottom: 0;
    padding: 6px 10px;
}

.opinion-input-row {
    display: flex;
    gap: 8px;
}

.opinion-input-row input {
    flex: 1;
    margin-bottom: 0;
}

.opinion-input-row button {
    width: auto;
    padding: 10px 16px;
}

.user-opinions-list {
    margin-top: 12px;
    max-height: 120px;
    overflow-y: auto;
}

.user-opinion-item {
    background: #242424;
    padding: 8px 10px;
    border-radius: 4px;
    margin-bottom: 4px;
    font-size: 0.85em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-opinion-item .opinion-author {
    color: #888;
    font-size: 0.85em;
    margin-left: 8px;
}

.toast {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    font-size: 0.9em;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.toast.error {
    background: #dc2626;
}

.toast.success {
    background: #16a34a;
}

.toast.info {
    background: #3b82f6;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.inline-error {
    color: #f87171;
    font-size: 0.85em;
    margin-top: -12px;
    margin-bottom: 12px;
    display: none;
}

.room-code-input {
    text-transform: uppercase;
    letter-spacing: 4px;
    text-align: center;
    font-size: 1.25em;
}

.btn-warning {
    background: #d97706;
    margin-top: 8px;
}

.btn-warning:hover {
    background: #b45309;
}

.guess-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.guess-option {
    background: #1a1a1a;
    border: 1px solid #444;
    color: #e0e0e0;
    padding: 12px 16px;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    font-size: 0.95em;
    width: 100%;
}

.guess-option:hover {
    border-color: #3b82f6;
    background: #222;
}

.spy-guess-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

.spy-guess-btn {
    background: #1a1a1a;
    border: 1px solid #444;
    color: #e0e0e0;
    padding: 10px 12px;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    font-size: 0.85em;
    transition: all 0.2s;
}

.spy-guess-btn:hover {
    border-color: #3b82f6;
    background: #222;
}

.spy-guess-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.result-card {
    background: #2a2a2a;
    padding: 32px;
    border-radius: 6px;
    text-align: center;
    margin-bottom: 16px;
    border: 1px solid #333;
}

.result-card.correct {
    border-color: #16a34a;
    background: #1a2e1a;
}

.result-card.wrong {
    border-color: #dc2626;
    background: #2a1a1a;
}

.result-card h2 {
    font-size: 1.25em;
    margin-bottom: 12px;
}

.result-text {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 8px;
}

.waiting-message {
    text-align: center;
    color: #888;
    padding: 24px;
}

.vote-option {
    background: #1a1a1a;
    border: 1px solid #444;
    color: #e0e0e0;
    padding: 12px 16px;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    font-size: 0.95em;
    width: 100%;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vote-option:hover {
    border-color: #3b82f6;
    background: #222;
}

.vote-option.voted {
    border-color: #3b82f6;
    background: #1a2a3a;
}

.vote-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.vote-count-badge {
    background: #3b82f6;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.8em;
}

.vote-result-item {
    background: #242424;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vote-result-item.is-spy {
    border: 1px solid #dc2626;
    background: #2a1a1a;
}

.vote-result-item.most-votes {
    border: 1px solid #d97706;
}

.spy-badge {
    background: #dc2626;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.75em;
    margin-left: 8px;
}

.opinion-file-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #333;
}

.file-format-hint {
    color: #888;
    font-size: 0.8em;
    margin-bottom: 12px;
    line-height: 1.4;
}

.file-example {
    color: #666;
    font-style: italic;
}

.opinion-file-buttons {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 8px 12px;
    font-size: 0.85em;
}

.timer-display {
    background: #1a1a1a;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 2em;
    font-weight: 700;
    color: #3b82f6;
    text-align: center;
    margin-bottom: 16px;
    font-variant-numeric: tabular-nums;
}

.timer-display.timer-warning {
    border-color: #f59e0b;
    color: #f59e0b;
    animation: pulse 1s infinite;
}

.timer-display.timer-expired {
    border-color: #dc2626;
    color: #dc2626;
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.vote-to-start-section {
    margin-bottom: 8px;
    text-align: center;
}

.btn-vote-start {
    background: #4b5563;
    margin-bottom: 4px;
}

.btn-vote-start:hover {
    background: #6b7280;
}

.btn-vote-start.voted {
    background: #166534;
    cursor: default;
}

.btn-vote-start.voted:hover {
    background: #166534;
}

.vote-status-text {
    color: #888;
    font-size: 0.85em;
    margin: 0;
}

.user-opinion-item .remove-opinion-btn {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 2px 6px;
    font-size: 0.9em;
    width: auto;
    margin: 0;
}

.user-opinion-item .remove-opinion-btn:hover {
    color: #f87171;
    background: transparent;
}

/* Ready Feature Styles */
.ready-section {
    margin-bottom: 16px;
    text-align: center;
}

.btn-ready {
    background: #4b5563;
    margin-bottom: 4px;
}

.btn-ready:hover {
    background: #6b7280;
}

.btn-ready.ready {
    background: #166534;
}

.btn-ready.ready:hover {
    background: #15803d;
}

.ready-status-text {
    color: #888;
    font-size: 0.85em;
    margin: 0;
}

.ready-badge {
    background: #16a34a;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight: 500;
    margin-left: 8px;
}

.not-ready-badge {
    background: #6b7280;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight: 500;
    margin-left: 8px;
}
