/* Pips - Main Styles */

/* CSS Variables */
:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #0f3460;
    --text-primary: #eaeaea;
    --text-secondary: #a0a0a0;
    --accent: #e94560;
    --accent-hover: #ff6b6b;
    --success: #4ade80;
    --error: #ef4444;
    --warning: #f59e0b;

    --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', monospace;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;

    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);

    --transition: 0.2s ease;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Base */
html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

#app {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Screen management */
.screen {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.screen.hidden {
    display: none;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--accent);
}

.user-identity {
    font-size: 14px;
    color: var(--text-secondary);
}

.timer, .solved-time {
    font-family: var(--font-mono);
    font-size: 18px;
    color: var(--text-primary);
}

/* Back button */
.back-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Buttons */
.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
}

.action-btn {
    background: var(--bg-card);
    color: var(--text-primary);
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition), opacity var(--transition);
}

.action-btn:hover:not(:disabled) {
    background: var(--bg-secondary);
}

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

/* Toast */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: toast-in 0.3s ease;
}

.toast.hidden {
    display: none;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-secondary);
    padding: 32px;
    border-radius: var(--radius-lg);
    text-align: center;
    max-width: 90%;
    box-shadow: var(--shadow-lg);
}

.modal-content h2 {
    margin-bottom: 16px;
    color: var(--success);
}

.win-time {
    font-family: var(--font-mono);
    font-size: 32px;
    margin-bottom: 24px;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Action bar */
.action-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-secondary);
}

/* Utilities */
.hidden {
    display: none !important;
}
