* {
    box-sizing: border-box;
}

.simple-pictionary {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0.5rem;
    font-family: Arial, sans-serif;
    width: 100%;
}

.simple-pictionary h2,
.simple-pictionary h3,
.simple-pictionary h4 {
    text-align: center;
    margin: 0.5rem 0;
}

.sp-buttons {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    margin-top: 1.5rem;
}

#sp-create-form,
#sp-join-form {
    width: 100%;
    max-width: 400px;
    padding: 0 0.5rem;
}

.sp-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.8rem;
}

.sp-form-group label {
    font-weight: bold;
    font-size: 0.95rem;
}

hr {
    width: 100%;
    max-width: 400px;
    border: 1px solid #ddd;
    margin: 0;
}

.sp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.sp-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.sp-word-container-top {
    max-width: 500px;
    margin: 0 auto 1rem auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.sp-word-container-top .sp-word-hidden,
.sp-word-container-top .sp-word-revealed {
    padding: 1.5rem;
    border: 2px dashed #ddd;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
}

.sp-word-hidden {
    background: #f5f5f5;
}

.sp-word-mask {
    font-size: 1.8rem;
    font-weight: bold;
    color: #999;
    display: block;
    margin-bottom: 0.4rem;
}

.sp-word-revealed {
    background: #e8f5e9;
    border-color: #4caf50 !important;
}

.sp-word-revealed span {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2e7d32;
}

.sp-change-word-btn {
    padding: 0.5rem 1rem;
    background: #ff9800;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.sp-change-word-btn:hover {
    background: #f57c00;
}

.sp-timer {
    margin: 1rem auto;
    padding: 0.5rem;
    background: #fff0f0;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
}

.sp-progress-container {
    height: 30px;
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.sp-progress-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    border-radius: 15px;
    transition: width 1s linear, background 0.3s ease;
}

.sp-progress-bar.warning {
    background: linear-gradient(90deg, #ff9800, #ffc107);
}

.sp-progress-bar.danger {
    background: linear-gradient(90deg, #f44336, #ff5722);
}

.sp-timer-text {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: #d63638;
}

.sp-game-area {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.sp-canvas-container {
    flex: 2 1 300px;
    min-width: 280px;
    width: 100%;
}

#sp-canvas {
    border: 2px solid #333;
    background: white;
    cursor: crosshair;
    width: 100%;
    height: auto;
    touch-action: none;
    display: block;
}

.sp-controls {
    display: flex;
    gap: 0.8rem;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-top: 0.8rem;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}

.sp-sidebar {
    flex: 1 1 220px;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    min-width: 220px;
    width: 100%;
}

.sp-play-btn {
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
    background: #4caf50;
}

.sp-play-btn:hover {
    background: #388e3c;
}

.sp-guess-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border: 1px solid #ddd;
    padding: 1rem;
    border-radius: 8px;
}

.sp-guess-container h4 {
    margin: 0;
}

.sp-guess-feedback {
    text-align: center;
    font-weight: bold;
    padding: 0.5rem;
    border-radius: 8px;
}

.sp-guess-feedback.success {
    background: #e8f5e9;
    color: #2e7d32;
}

.sp-guess-feedback.error {
    background: #ffebee;
    color: #c62828;
}

.sp-players {
    border: 1px solid #ddd;
    padding: 0.8rem;
    border-radius: 8px;
}

.sp-players ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.2rem;
}

button {
    padding: 0.6rem 1rem;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

button:hover {
    background: #005177;
}

input[type="text"],
input[type="number"],
input[type="color"] {
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    width: 100%;
    font-size: 1rem;
}

input[type="range"] {
    flex: 1;
    min-width: 80px;
}

#sp-rooms-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#sp-rooms-list li {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

#sp-rooms-list li:hover {
    background: #f5f5f5;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .simple-pictionary {
        padding: 0.3rem;
        margin: 0.5rem auto;
    }
    
    .sp-header {
        flex-direction: column;
        text-align: center;
    }
    
    .sp-word-mask,
    .sp-word-revealed span {
        font-size: 1.4rem;
    }
    
    .sp-controls {
        gap: 0.5rem;
        padding: 0.6rem;
    }
}

@media (max-width: 480px) {
    .sp-word-mask,
    .sp-word-revealed span {
        font-size: 1.2rem;
    }
    
    button {
        padding: 0.5rem 0.8rem;
        font-size: 0.95rem;
    }
}
