@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Righteous&display=swap');

:root {
    --color-primary: #FF6B6B;
    --color-secondary: #4ECDC4;
    --color-accent: #FFE66D;
    --color-purple: #A78BFA;
    --color-success: #51CF66;
    --color-danger: #FF6B6B;
    
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-card: #FFFFFF;
    --bg-screen: #F8F9FA;
    
    --text-primary: #2D3748;
    --text-secondary: #718096;
    --text-light: #FFFFFF;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.16);
    
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

#sorteio-temas-app {
    font-family: 'Nunito', sans-serif;
    color: var(--text-primary);
    min-height: 100vh;
    background: var(--bg-screen);
    position: relative;
    overflow-x: hidden;
}

/* Telas */
.st-screen {
    min-height: 100vh;
    padding: 20px;
    padding-bottom: 100px;
    animation: fadeIn 0.4s ease;
}

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

/* Loading */
#st-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.st-loader {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Header */
.st-header {
    margin-bottom: 30px;
    position: relative;
}

.st-title {
    font-family: 'Righteous', cursive;
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    animation: slideDown 0.6s ease;
}

.st-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    animation: slideDown 0.6s ease 0.1s backwards;
}

.st-screen-title {
    font-family: 'Righteous', cursive;
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.st-progress {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
}

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

/* Botões */
.st-btn {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    padding: 16px 32px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.st-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.st-btn:active::before {
    width: 300px;
    height: 300px;
}

.st-btn-primary {
    background: linear-gradient(135deg, var(--color-primary), #FF8E53);
    color: var(--text-light);
}

.st-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.st-btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid #E2E8F0;
}

.st-btn-secondary:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.st-btn-fab {
    position: fixed;
    bottom: 30px;
    right: 20px;
    left: 20px;
    max-width: calc(100% - 40px);
    z-index: 100;
    font-size: 1.1rem;
    padding: 20px;
    box-shadow: var(--shadow-lg);
}

.st-btn-fab span {
    font-size: 1.5rem;
    font-weight: 400;
}

.st-btn-back {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px;
    margin-bottom: 16px;
    transition: color var(--transition-fast);
    font-family: 'Nunito', sans-serif;
}

.st-btn-back:hover {
    color: var(--text-primary);
}

.st-btn-sortear {
    font-size: 1.3rem;
    padding: 24px;
    margin-top: 20px;
    animation: pulse 2s ease infinite;
}

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

/* Cards */
.st-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.st-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary), var(--color-accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-normal);
}

.st-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.st-card:hover::after {
    transform: scaleX(1);
}

/* Lista de Partidas */
.st-matches-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.st-match-card {
    display: flex;
    align-items: center;
    gap: 16px;
    animation: slideUp 0.4s ease backwards;
}

.st-match-card:nth-child(1) { animation-delay: 0.1s; }
.st-match-card:nth-child(2) { animation-delay: 0.2s; }
.st-match-card:nth-child(3) { animation-delay: 0.3s; }

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

.st-match-info {
    flex: 1;
}

.st-match-name {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.st-match-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.st-match-actions {
    display: flex;
    gap: 8px;
}

.st-btn-icon {
    background: var(--bg-screen);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    font-size: 1.1rem;
}

.st-btn-icon:hover {
    background: var(--color-primary);
    color: white;
    transform: scale(1.1);
}

.st-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.st-empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Formulários */
.st-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.st-label {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: block;
}

.st-input {
    width: 100%;
    padding: 16px;
    border: 2px solid #E2E8F0;
    border-radius: var(--radius-md);
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    transition: all var(--transition-fast);
    background: var(--bg-card);
}

.st-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

/* Jogadores */
.st-jogadores-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.st-jogador-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    animation: scaleIn 0.3s ease backwards;
}

.st-jogador-item:nth-child(1) { animation-delay: 0.05s; }
.st-jogador-item:nth-child(2) { animation-delay: 0.1s; }
.st-jogador-item:nth-child(3) { animation-delay: 0.15s; }
.st-jogador-item:nth-child(4) { animation-delay: 0.2s; }

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.st-player-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-accent);
    background: linear-gradient(135deg, var(--color-secondary), var(--color-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.st-player-avatar-large {
    width: 80px;
    height: 80px;
    font-size: 2rem;
}

.st-jogador-info {
    flex: 1;
}

.st-file-upload {
    position: relative;
    cursor: pointer;
}

.st-file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Modo de Temas */
.st-modo-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 600px) {
    .st-modo-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

.st-modo-card {
    text-align: center;
    padding: 32px 20px;
    border: 3px solid transparent;
}

.st-modo-card:hover {
    border-color: var(--color-primary);
}

.st-modo-card.selected {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(167, 139, 250, 0.1));
}

.st-modo-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.st-modo-card h3 {
    font-family: 'Righteous', cursive;
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.st-modo-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Temas */
.st-tema-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
    animation: scaleIn 0.3s ease backwards;
}

.st-tema-item input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
}

.st-tema-item input:focus {
    outline: none;
}

.st-btn-remove {
    background: rgba(255, 107, 107, 0.1);
    color: var(--color-danger);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.st-btn-remove:hover {
    background: var(--color-danger);
    color: white;
}

/* Modo Velado */
.st-velado-info {
    text-align: center;
    padding: 32px 20px;
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.1), rgba(167, 139, 250, 0.1));
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.st-current-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.st-current-player h3 {
    font-family: 'Righteous', cursive;
    font-size: 1.5rem;
}

.st-velado-instruction {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Jogo */
.st-jogo-container {
    max-width: 600px;
    margin: 0 auto;
}

.st-tema-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-xl);
    padding: 48px 24px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    margin-bottom: 32px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.st-tema-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

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

.st-tema-content {
    position: relative;
    z-index: 1;
}

.st-tema-icon {
    font-size: 4rem;
    margin-bottom: 24px;
    animation: bounce 2s ease infinite;
}

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

.st-tema-text {
    font-family: 'Righteous', cursive;
    font-size: 2rem;
    color: white;
    line-height: 1.4;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.st-tema-card.sorteando .st-tema-icon {
    animation: spin 0.5s linear infinite;
}

.st-tema-card.revelado {
    animation: revealCard 0.6s ease;
}

@keyframes revealCard {
    0% {
        transform: scale(0.9) rotateY(90deg);
    }
    100% {
        transform: scale(1) rotateY(0deg);
    }
}

.st-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.st-stat {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.st-stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.st-stat-value {
    display: block;
    font-family: 'Righteous', cursive;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Responsividade */
@media (max-width: 600px) {
    .st-screen {
        padding: 16px;
        padding-bottom: 100px;
    }
    
    .st-title {
        font-size: 2rem;
    }
    
    .st-screen-title {
        font-size: 1.5rem;
    }
    
    .st-tema-text {
        font-size: 1.5rem;
    }
    
    .st-tema-card {
        padding: 32px 20px;
        min-height: 250px;
    }
}

/* Utilidades */
.st-mb-1 { margin-bottom: 8px; }
.st-mb-2 { margin-bottom: 16px; }
.st-mb-3 { margin-bottom: 24px; }
.st-mt-1 { margin-top: 8px; }
.st-mt-2 { margin-top: 16px; }
.st-mt-3 { margin-top: 24px; }

.st-text-center { text-align: center; }
.st-text-muted { color: var(--text-secondary); }
