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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.5s ease;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(45deg, rgba(0,0,0,0.03) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(0,0,0,0.03) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(0,0,0,0.03) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(0,0,0,0.03) 75%);
    background-size: 40px 40px;
    background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    max-width: 800px;
    width: 100%;
}

body.yes {
    background: linear-gradient(135deg, #00c853 0%, #1de9b6 100%);
}

body.no {
    background: linear-gradient(135deg, #ff1744 0%, #ff6d00 100%);
}

body.loading-state {
    background: linear-gradient(135deg, #424242 0%, #616161 100%);
}

body.too-early {
    background: linear-gradient(135deg, #7b1fa2 0%, #9c27b0 100%);
}

body.in-progress {
    background: linear-gradient(135deg, #1565c0 0%, #42a5f5 100%);
}

body.results {
    background: linear-gradient(135deg, #f57c00 0%, #ffb74d 100%);
}

.container {
    text-align: center;
    padding: 2rem;
    max-width: 800px;
    width: 100%;
}

.title {
    font-size: 2.5rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
}

.loading {
    color: white;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.result {
    animation: fadeIn 0.5s ease;
}

.result.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.answer {
    font-size: 12rem;
    font-weight: 900;
    color: white;
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3);
    line-height: 1;
    margin-bottom: 1rem;
}

@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }
    .answer {
        font-size: 5rem;
    }
    .title {
        font-size: 1.3rem;
    }
    .meme img {
        max-height: 200px;
    }
    .meme-text {
        font-size: 1.1rem;
    }
    .check-btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

.meme {
    max-width: 100%;
    margin: 1rem auto;
}

.meme img {
    max-width: 400px;
    max-height: 300px;
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.meme-text {
    font-size: 1.5rem;
    color: white;
    margin-top: 1rem;
    font-style: italic;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.round-info {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 1rem;
}

.pairing-info {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    margin: 1rem auto;
    max-width: 400px;
    text-align: center;
}

.pairing-info.hidden {
    display: none;
}

.pairing-result {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.75rem;
}

.pairing-opponent {
    font-size: 1.4rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.color-icon {
    width: 2.5rem;
    height: 2.5rem;
    object-fit: contain;
}

.pairing-opponent .opponent-link {
    color: white;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.pairing-opponent .opponent-link:hover {
    color: rgba(255, 255, 255, 0.8);
}

.pairing-details {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
}

.pairing-board {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
    margin-right: 0.5rem;
    font-weight: 600;
}

@media (max-width: 600px) {
    .pairing-info {
        padding: 1rem;
    }
    .pairing-opponent {
        font-size: 1.2rem;
    }
}

.refresh-container {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.button-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.check-btn {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    background: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.check-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.check-btn:active {
    transform: translateY(0);
}

.share-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.share-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.3);
}

.share-btn:active {
    transform: translateY(0);
}

.share-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.share-toast.show {
    opacity: 1;
    pointer-events: auto;
}

.countdown {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.15);
    padding: 0.4rem 1rem;
    border-radius: 20px;
}

#countdown-time {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.footer {
    margin-top: 2rem;
}

.footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-size: 0.9rem;
    cursor: pointer;
}

.footer a:hover {
    color: white;
    text-decoration: underline;
}

.footer-divider {
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0.5rem;
}

/* Settings Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
    pointer-events: none;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content h2 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.setting-group {
    margin-bottom: 1.5rem;
}

.setting-group label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.setting-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transition: border-color 0.2s ease;
}

.setting-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.setting-group input:focus {
    outline: none;
    border-color: #00c853;
}

.setting-hint {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    margin-top: 0.5rem;
    line-height: 1.4;
}

.modal-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.modal-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-btn:hover {
    transform: translateY(-2px);
}

.modal-btn-primary {
    background: linear-gradient(135deg, #00c853 0%, #1de9b6 100%);
    color: white;
}

.modal-btn-primary:hover {
    box-shadow: 0 4px 15px rgba(0, 200, 83, 0.4);
}

.modal-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* SMS Notification UI */
.phone-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.phone-input-row input {
    flex: 1;
}

.phone-input-row .modal-btn {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

.phone-status {
    font-size: 0.85rem;
    margin-top: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
}

.phone-status-error {
    color: #ff6b6b;
    background: rgba(255, 23, 68, 0.1);
}

.phone-status-success {
    color: #69db7c;
    background: rgba(0, 200, 83, 0.1);
}

.sms-status-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sms-status-badge {
    display: inline-block;
    background: linear-gradient(135deg, #00c853 0%, #1de9b6 100%);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.modal-btn-small {
    padding: 0.4rem 0.75rem !important;
    font-size: 0.8rem !important;
}

.hidden {
    display: none;
}

/* Debug panel */
.debug-panel {
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.debug-panel p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.debug-panel button {
    margin: 0.25rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
}

.debug-panel button:hover {
    background: rgba(255, 255, 255, 0.3);
}
