/* ===========================================
   Dos Verdades y Una Mentira - Styles
   Mobile-first design (320px base)
   =========================================== */

/* CSS Variables */
:root {
    --color-primary: #6C5CE7;
    --color-primary-dark: #5B4BD5;
    --color-secondary: #A29BFE;
    --color-success: #00B894;
    --color-success-dark: #00A085;
    --color-danger: #E17055;
    --color-danger-dark: #D15D43;
    --color-warning: #FDCB6E;
    --color-bg: #1A1A2E;
    --color-bg-lighter: #232342;
    --color-card: #16213E;
    --color-card-hover: #1E2A4A;
    --color-text: #FFFFFF;
    --color-text-muted: #A0A0A0;
    --color-border: #2D2D5A;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-button: 0 4px 8px rgba(0, 0, 0, 0.2);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 50%;
}

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

/* Base */
html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    min-height: 100dvh;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Screen Management */
.screen {
    display: none;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Container */
.container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.container.center-content {
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: calc(100vh - 2rem);
    min-height: calc(100dvh - 2rem);
}

/* Typography */
h1 {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
}

h3 {
    font-size: 1rem;
    font-weight: 600;
}

.subtitle {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 1rem;
}

.hint {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.info {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    margin-top: auto;
}

/* Logo */
.logo {
    font-size: 4rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

.trophy {
    font-size: 5rem;
    text-align: center;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 52px;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

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

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

.btn-primary {
    background: var(--color-primary);
    color: var(--color-text);
    box-shadow: var(--shadow-button);
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-dark);
}

.btn-secondary {
    background: var(--color-card);
    color: var(--color-text);
    border: 2px solid var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--color-card-hover);
}

.btn-add {
    background: transparent;
    color: var(--color-secondary);
    border: 2px dashed var(--color-border);
    width: 100%;
}

.btn-add:hover:not(:disabled) {
    border-color: var(--color-secondary);
    background: rgba(162, 155, 254, 0.1);
}

.btn-add span {
    font-size: 1.25rem;
    font-weight: 700;
}

.btn-remove {
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    background: transparent;
    color: var(--color-danger);
    border: none;
    border-radius: var(--radius-full);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.btn-remove:hover {
    background: rgba(225, 112, 85, 0.2);
}

/* Form Elements */
.form-group {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.form-group label {
    font-weight: 600;
    color: var(--color-text-muted);
    min-width: 1.5rem;
    padding-top: 0.75rem;
}

input[type="text"],
textarea {
    flex: 1;
    min-height: 48px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--color-text);
    background: var(--color-card);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color var(--transition-fast);
}

input[type="text"]:focus,
textarea:focus {
    border-color: var(--color-primary);
}

input::placeholder,
textarea::placeholder {
    color: var(--color-text-muted);
}

textarea {
    resize: none;
    min-height: 60px;
}

/* Players Setup */
.players-setup {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    padding: 1rem;
}

.players-setup h2 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    text-align: left;
}

.players-input-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.player-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.player-number {
    min-width: 1.5rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-align: center;
}

/* Pass Device Screen */
.pass-icon {
    font-size: 5rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.pass-instruction {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    margin-top: 1rem;
}

.pass-name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    padding: 0.5rem 1.5rem;
    background: rgba(108, 92, 231, 0.2);
    border-radius: var(--radius-lg);
}

.pass-hint {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-top: 0.5rem;
}

.progress-indicator {
    background: var(--color-card);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin: 1.5rem 0;
}

/* Phase Header */
.phase-header {
    text-align: center;
    margin-bottom: 0.5rem;
}

.phase-badge {
    display: inline-block;
    padding: 0.375rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.phase-badge.writing {
    background: var(--color-primary);
}

.phase-badge.voting {
    background: var(--color-warning);
    color: #1A1A2E;
}

.phase-badge.reveal {
    background: var(--color-success);
}

/* Statements Form */
.statements-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}

/* Lie Selector */
.lie-selector {
    background: var(--color-card);
    padding: 1rem;
    border-radius: var(--radius-md);
    text-align: center;
}

.lie-selector p {
    margin-bottom: 0.75rem;
}

.radio-group {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.radio-option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.radio-option input {
    display: none;
}

.radio-option span {
    font-size: 1.25rem;
    font-weight: 700;
}

.radio-option:has(input:checked) {
    background: var(--color-danger);
    border-color: var(--color-danger);
}

.radio-option:hover:not(:has(input:checked)) {
    border-color: var(--color-danger);
}

/* Error Text */
.error-text {
    color: var(--color-danger);
    font-size: 0.875rem;
    text-align: center;
}

/* Confirm Screen */
.confirm-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.confirm-warning {
    color: var(--color-warning);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.confirm-preview {
    background: var(--color-card);
    border-radius: var(--radius-md);
    padding: 1rem;
    width: 100%;
    text-align: left;
}

.preview-item {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.875rem;
}

.preview-item:last-of-type {
    border-bottom: none;
}

.preview-number {
    color: var(--color-text-muted);
    font-weight: 600;
    min-width: 1.5rem;
}

.preview-lie {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--color-danger);
    color: var(--color-danger);
    text-align: center;
}

.confirm-buttons {
    display: flex;
    gap: 1rem;
    width: 100%;
    margin-top: 1.5rem;
}

.confirm-buttons .btn {
    flex: 1;
}

/* Success Screen */
.success-icon {
    font-size: 5rem;
    animation: popIn 0.5s ease;
}

@keyframes popIn {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Voting Options */
.voting-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}

.voting-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-card);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}

.voting-option:hover {
    border-color: var(--color-danger);
    background: var(--color-card-hover);
}

.voting-option:active {
    transform: scale(0.98);
}

.voting-option .option-number {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border-radius: var(--radius-full);
    font-weight: 700;
    flex-shrink: 0;
}

.voting-option .option-text {
    flex: 1;
    font-size: 0.9375rem;
    line-height: 1.4;
}

.voting-instruction {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.presenter-info {
    text-align: center;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.presenter-info span {
    color: var(--color-primary);
    font-weight: 600;
}

/* Reveal Screen */
.reveal-statements {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}

.reveal-statement {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.reveal-statement.truth {
    background: rgba(0, 184, 148, 0.15);
    border: 2px solid var(--color-success);
}

.reveal-statement.lie {
    background: rgba(225, 112, 85, 0.15);
    border: 2px solid var(--color-danger);
}

.reveal-statement .statement-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.reveal-statement .statement-content {
    flex: 1;
}

.reveal-statement .statement-text {
    font-size: 0.9375rem;
    line-height: 1.4;
}

.reveal-statement.lie .lie-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-danger);
    text-transform: uppercase;
    margin-top: 0.25rem;
}

/* Reveal Results */
.reveal-results {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin: 1rem 0;
}

.result-section {
    margin-bottom: 1rem;
}

.result-section:last-of-type {
    margin-bottom: 0;
}

.result-section h3 {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.result-section.correct h3 {
    color: var(--color-success);
}

.result-section.wrong h3 {
    color: var(--color-danger);
}

.guessers-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.guessers-list li {
    background: var(--color-bg);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
}

.guessers-list li.correct {
    color: var(--color-success);
}

.guessers-list li.wrong {
    color: var(--color-text-muted);
}

.guessers-list .empty {
    color: var(--color-text-muted);
    font-style: italic;
}

.fooled-section {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    margin-top: 1rem;
}

.fooled-section p {
    color: var(--color-text-muted);
}

.fooled-section span {
    color: var(--color-text);
    font-weight: 600;
}

.points-earned {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-success) !important;
    margin-top: 0.25rem;
}

/* Results Screen */
.results-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    margin: 1.5rem 0;
}

.results-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-card);
    border-radius: var(--radius-md);
}

.results-list .rank {
    font-size: 1.5rem;
    min-width: 2.5rem;
    text-align: center;
}

.results-list .player-name {
    flex: 1;
    font-weight: 600;
}

.results-list .player-score {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
}

.results-list li:first-child {
    background: linear-gradient(135deg, rgba(253, 203, 110, 0.3), rgba(253, 203, 110, 0.1));
    border: 2px solid var(--color-warning);
}

.results-list li:first-child .player-score {
    color: var(--color-warning);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-card);
    color: var(--color-text);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-card);
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

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

/* Responsive */
@media (min-width: 768px) {
    .container {
        max-width: 500px;
    }

    h1 {
        font-size: 2.5rem;
    }

    .logo {
        font-size: 5rem;
    }
}
