/* Speaking Game Public Styles */

:root {
    --sg-primary: #e2725b; /* Terracotta */
    --sg-secondary: #d2b48c; /* Light brown */
    --sg-accent: #add8e6; /* Light blue */
    --sg-accent-secondary: #87ceeb;
    
    --sg-bg-gradient: linear-gradient(135deg, #f5f0e6 0%, #e6f3f7 100%);
    --sg-glass-bg: rgba(255, 255, 255, 0.7);
    --sg-glass-border: rgba(255, 255, 255, 0.9);
    --sg-glass-shadow: 0 8px 32px 0 rgba(142, 116, 97, 0.15);
    
    --sg-text: #4a4a4a;
    --sg-text-light: #7a7a7a;
    
    --sg-font: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.sg-game-wrapper {
    font-family: var(--sg-font);
    color: var(--sg-text);
    background: var(--sg-bg-gradient);
    min-height: 80vh;
    padding: 2rem;
    border-radius: 20px;
    position: relative;
    box-sizing: border-box;
}

.sg-game-wrapper * {
    box-sizing: border-box;
}

.sg-screen {
    display: none;
    animation: sgFadeIn 0.5s ease;
}

.sg-active-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

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

.sg-glass-panel {
    background: var(--sg-glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--sg-glass-border);
    border-radius: 20px;
    box-shadow: var(--sg-glass-shadow);
    padding: 2rem;
    width: 100%;
    max-width: 600px;
}

.sg-title {
    text-align: center;
    color: var(--sg-primary);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    margin-top: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.sg-subtitle {
    text-align: center;
    color: var(--sg-text-light);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.sg-players-setup, .sg-categories-setup {
    margin-bottom: 2rem;
}

.sg-players-setup h2, .sg-categories-setup h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--sg-text);
    border-bottom: 2px solid var(--sg-primary);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.sg-player-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.sg-tab-btn {
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid var(--sg-secondary);
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--sg-text);
    cursor: pointer;
    transition: all 0.3s ease;
}

.sg-tab-btn:hover {
    background: var(--sg-accent);
    border-color: var(--sg-accent);
}

.sg-tab-btn.active {
    background: var(--sg-primary);
    border-color: var(--sg-primary);
    color: white;
}

.sg-player-input-group {
    margin-bottom: 1rem;
}

.sg-player-input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    transition: all 0.3s;
    color: #333;
}

.sg-player-input:focus {
    outline: none;
    border-color: var(--sg-accent);
    box-shadow: 0 0 10px rgba(0, 201, 255, 0.3);
}

.sg-checkbox-group {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.sg-checkbox-group label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sg-checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.sg-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sg-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.sg-btn-primary {
    background: linear-gradient(45deg, var(--sg-primary), var(--sg-secondary));
    color: white;
    width: 100%;
    margin-top: 1rem;
}

.sg-btn-secondary {
    background: var(--sg-accent);
    color: white;
    font-size: 0.9rem;
    padding: 8px 15px;
}

/* Board Styles */
.sg-board-header {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

#sg-turn-indicator {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    color: var(--sg-primary);
    margin: 0;
    max-width: 300px;
}

.sg-board-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

#sg-board {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(5px, 1.5vw, 10px);
    justify-content: center;
    max-width: 900px;
    margin-bottom: 2rem;
}

.sg-cell {
    width: clamp(60px, 10vw, 100px);
    height: clamp(60px, 10vw, 100px);
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 5px;
    box-shadow: var(--sg-glass-shadow);
    border: 2px solid transparent;
    transition: all 0.3s;
    position: relative;
    font-weight: 600;
    font-size: clamp(0.6rem, 1.2vw, 0.8rem);
}

.sg-cell-number {
    position: absolute;
    top: 5px;
    left: 10px;
    font-size: 0.8rem;
    color: #999;
}

.sg-cell.active-cell {
    border-color: var(--sg-primary);
    transform: scale(1.05);
}

/* Player Tokens */
.sg-tokens-container {
    position: absolute;
    bottom: 5px;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.sg-token {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Colors for players */
.sg-player-0 { background-color: #FF3366; }
.sg-player-1 { background-color: #33CCFF; }
.sg-player-2 { background-color: #FFCC00; }
.sg-player-3 { background-color: #33FF99; }
.sg-player-4 { background-color: #9933FF; }
.sg-player-5 { background-color: #FF9933; }

/* Dice */
.sg-dice-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    padding: 1rem 2rem;
    margin: 0;
    width: auto;
    max-width: 300px;
}

.sg-dice-container .sg-btn {
    margin-top: 0;
    font-size: 1rem;
    padding: 8px 15px;
}

.sg-dice {
    font-size: 3rem;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: none;
}

.sg-dice.rolling {
    animation: rollDice 0.5s linear infinite;
}

@keyframes rollDice {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}

/* Modal */
.sg-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 100;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.sg-modal-overlay.active {
    display: flex;
}

.sg-modal-content {
    max-width: 500px;
    width: 100%;
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

#sg-modal-title {
    color: var(--sg-primary);
    margin-top: 0;
    border-bottom: 2px solid rgba(0,0,0,0.1);
    padding-bottom: 10px;
}

#sg-modal-body {
    font-size: 1.2rem;
    line-height: 1.6;
    margin: 20px 0;
}

.sg-modal-actions {
    display: flex;
    justify-content: flex-end;
}

/* Category specific colors - Milder tones */
.cat-повествования { background: linear-gradient(135deg, #e6f3f7 0%, #add8e6 100%); }
.cat-ролевыеигры { background: linear-gradient(135deg, #f5f0e6 0%, #d2b48c 100%); }
.cat-такиеновости { background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%); }
.cat-задайтривопроса { background: linear-gradient(135deg, #fdece8 0%, #f7d1c9 100%); }
.cat-инструкции { background: linear-gradient(135deg, #dff0e6 0%, #b2d8c3 100%); }
.cat-направления { background: linear-gradient(135deg, #f4e8d3 0%, #e2cd9c 100%); }
.cat-описания { background: linear-gradient(135deg, #e8f0fe 0%, #bacced 100%); }
.cat-естьмнение { background: linear-gradient(135deg, #fae3e3 0%, #e8bcbc 100%); }

.cat-вашшанс { background: linear-gradient(135deg, #e2725b 0%, #d2b48c 100%); color: white;}
.cat-тюрьма { background: linear-gradient(135deg, #7a7a7a 0%, #4a4a4a 100%); color: white;}
.cat-ходназад { background: linear-gradient(135deg, #d2b48c 0%, #c4a484 100%); }
.cat-дваходавперед { background: linear-gradient(135deg, #87ceeb 0%, #4682b4 100%); color: white;}
.cat-start, .cat-finish { background: linear-gradient(135deg, #add8e6 0%, #87ceeb 100%); color: #333; }
