/**
 * Word Scramble - Style Sheet
 * Rich jewel-tone theme for timed word-finding puzzle
 */

/* ==================== BASE ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #1a1028; }

.lg-game-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1028 0%, #0d0a1a 100%);
}

#game-canvas {
    display: block;
    cursor: default;
    border-radius: 0;
    box-shadow: none;
}

/* ==================== MENU OVERLAY ==================== */
.ws-menu {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(60,30,100,0.95), rgba(25,15,50,0.98));
    z-index: 100;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    text-align: center;
}

.ws-menu h1 {
    font-size: 3.5rem;
    font-weight: 800;
    color: #e8b4f8;
    text-shadow: 0 3px 10px rgba(180,100,255,0.5), 0 0 40px rgba(180,100,255,0.2);
    margin-bottom: 8px;
    letter-spacing: 3px;
}

.ws-menu .ws-subtitle {
    font-size: 1rem;
    color: #b090d0;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.ws-menu .ws-how {
    max-width: 360px;
    color: #9080b0;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 24px;
}

/* Buttons */
.ws-btn {
    display: block;
    width: 260px;
    margin: 8px auto;
    padding: 14px 28px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    background: linear-gradient(135deg, #6b3fa0, #9060d0);
    border: 2px solid #c090ff;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.ws-btn:hover {
    background: linear-gradient(135deg, #9060d0, #c090ff);
    color: #1a1028;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(180,100,255,0.4);
}

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

.ws-btn-emerald {
    background: linear-gradient(135deg, #22aa44, #33cc55);
    border-color: #66ee77;
}

.ws-btn-emerald:hover {
    background: linear-gradient(135deg, #33cc55, #66ee77);
    color: #fff;
}

.ws-btn-amber {
    background: linear-gradient(135deg, #cc8800, #eea030);
    border-color: #ffc060;
}

.ws-btn-amber:hover {
    background: linear-gradient(135deg, #eea030, #ffc060);
    color: #1a1028;
}

.ws-btn-small {
    width: 180px;
    padding: 10px 20px;
    font-size: 0.85rem;
    border-width: 1px;
}

/* ==================== HUD ==================== */
.ws-hud {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 50;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

.ws-hud-top {
    position: absolute;
    top: 10px; left: 10px; right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.ws-hud-item {
    padding: 8px 16px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(180,100,255,0.3);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    backdrop-filter: blur(4px);
}

.ws-timer {
    font-size: 1.3rem;
    min-width: 80px;
    text-align: center;
}

.ws-timer.warning {
    color: #ff3344;
    animation: ws-pulse 0.5s ease-in-out infinite alternate;
    border-color: #ff3344;
}

@keyframes ws-pulse {
    from { opacity: 0.7; transform: scale(1); }
    to { opacity: 1; transform: scale(1.05); }
}

.ws-round {
    color: #e8b4f8;
}

.ws-score {
    color: #ffc060;
    font-size: 1.1rem;
}

/* Current word display */
.ws-current-word {
    position: absolute;
    top: 55px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 24px;
    min-width: 200px;
    min-height: 40px;
    background: rgba(0,0,0,0.4);
    border: 2px solid rgba(180,100,255,0.4);
    border-radius: 12px;
    color: #fff;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 6px;
    text-align: center;
    text-transform: uppercase;
}

/* Game action buttons */
.ws-game-buttons {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    pointer-events: auto;
}

.ws-game-btn {
    padding: 10px 24px;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    border: 2px solid rgba(180,100,255,0.4);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ws-submit-btn {
    background: linear-gradient(135deg, #22aa44, #33cc55);
    border-color: #66ee77;
}

.ws-submit-btn:hover {
    background: linear-gradient(135deg, #33cc55, #66ee77);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(51,204,85,0.4);
}

.ws-shuffle-btn {
    background: linear-gradient(135deg, #cc8800, #eea030);
    border-color: #ffc060;
}

.ws-shuffle-btn:hover {
    background: linear-gradient(135deg, #eea030, #ffc060);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(238,160,48,0.4);
}

.ws-clear-btn {
    background: linear-gradient(135deg, #cc2233, #ff3344);
    border-color: #ff6677;
}

.ws-clear-btn:hover {
    background: linear-gradient(135deg, #ff3344, #ff6677);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,51,68,0.4);
}

.ws-game-btn:active {
    transform: translateY(0);
}

/* Found words panel */
.ws-found-panel {
    position: absolute;
    top: 55px;
    right: 10px;
    bottom: 140px;
    width: 160px;
    padding: 10px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(180,100,255,0.25);
    border-radius: 10px;
    backdrop-filter: blur(4px);
    overflow-y: auto;
    overflow-x: hidden;
}

.ws-found-title {
    color: #b090d0;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
    text-align: center;
}

.ws-found-list {
    list-style: none;
}

.ws-found-list li {
    padding: 3px 8px;
    margin: 2px 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #e0d0f0;
    background: rgba(100,60,180,0.2);
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
}

.ws-found-list li .pts {
    color: #ffc060;
    font-size: 0.75rem;
}

.ws-found-list li.new-word {
    animation: ws-word-pop 0.3s ease-out;
}

@keyframes ws-word-pop {
    0% { transform: translateX(20px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

.ws-found-panel::-webkit-scrollbar {
    width: 4px;
}

.ws-found-panel::-webkit-scrollbar-thumb {
    background: rgba(180,100,255,0.3);
    border-radius: 2px;
}

/* ==================== BRIEFING OVERLAY ==================== */
.ws-briefing {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.8);
    z-index: 90;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    text-align: center;
    color: #fff;
}

.ws-briefing h2 {
    font-size: 2.5rem;
    color: #e8b4f8;
    text-shadow: 0 2px 10px rgba(180,100,255,0.4);
    margin-bottom: 12px;
}

.ws-briefing p {
    font-size: 1.1rem;
    color: #b090d0;
    margin-bottom: 8px;
}

/* ==================== ROUND COMPLETE ==================== */
.ws-round-complete {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.8);
    z-index: 90;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    text-align: center;
    color: #fff;
}

.ws-round-complete h2 {
    font-size: 2.2rem;
    color: #33cc55;
    text-shadow: 0 2px 15px rgba(51,204,85,0.4);
    margin-bottom: 10px;
}

.ws-round-stats {
    display: flex;
    gap: 30px;
    margin: 15px 0;
}

.ws-round-stat {
    text-align: center;
}

.ws-round-stat .value {
    font-size: 2rem;
    font-weight: 800;
    color: #ffc060;
}

.ws-round-stat .label {
    font-size: 0.7rem;
    color: #b090d0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ==================== GAME OVER OVERLAY ==================== */
.ws-gameover {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.85);
    z-index: 100;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    text-align: center;
    color: #fff;
}

.ws-gameover h2 {
    font-size: 2.8rem;
    color: #e8b4f8;
    text-shadow: 0 3px 15px rgba(180,100,255,0.4);
    margin-bottom: 10px;
}

.ws-gameover .ws-final-score {
    font-size: 3rem;
    font-weight: 800;
    color: #ffc060;
    text-shadow: 0 2px 10px rgba(255,192,96,0.3);
    margin: 10px 0;
}

.ws-gameover .ws-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.ws-stat-item {
    text-align: center;
}

.ws-stat-item .value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #e8b4f8;
}

.ws-stat-item .label {
    font-size: 0.7rem;
    color: #b090d0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 600px) {
    .ws-menu h1 { font-size: 2.2rem; }
    .ws-btn { width: 200px; padding: 10px 20px; font-size: 0.9rem; }
    .ws-hud-item { padding: 5px 10px; font-size: 0.8rem; }
    .ws-timer { font-size: 1rem; }
    .ws-current-word { font-size: 1.3rem; min-width: 150px; }
    .ws-found-panel { width: 120px; }
    .ws-game-btn { padding: 8px 16px; font-size: 0.8rem; }
}
