/* ═══════════════════════════════════════════════════════════════
   SPACE HANGMAN - Game Styles
   File: %OneDrive%\CODING\APPS\Ultracirculum_Hub\ultracirculum.cloud\spacehangman\spacehangman.css
   Theme: Ultracirculum dark space + mint/coral neon accents
   Layout rule: Flexbox/Grid only (overlay stacking via grid-area 1/1)
   ═══════════════════════════════════════════════════════════════ */

:root {
    --standard-spacing: 20px;
    --shg-accent: #6BFFB8;
    --shg-accent-2: #FF9E6B;
    --shg-glass-bg: rgba(3, 7, 18, 0.2);
    --shg-panel-bg: rgba(3, 7, 18, 0.55);
    --shg-border: rgba(107, 255, 184, 0.35);
    --shg-text: #EAFFF4;
    --shg-text-dim: rgba(234, 255, 244, 0.65);
}

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

body {
    min-height: 100vh;
    background: radial-gradient(ellipse at 50% 0%, #0B2418 0%, #06140E 55%, #030712 100%);
    color: var(--shg-text);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
}

/* Background animation canvases (hub pattern) */
.stars, .fireflies, .fireflies-front {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
}

.stars { z-index: 0; }
.fireflies { z-index: 1; }
.fireflies-front { z-index: 2; }

.shg-page {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 840px;
    display: flex;
    flex-direction: column;
    gap: var(--standard-spacing);
    padding: var(--standard-spacing);
}

/* Top navigation (hub pattern) */
.shg-top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(15, 15, 40, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.home-btn {
    background: rgba(15, 15, 40, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-btn:hover {
    background: rgba(107, 255, 184, 0.2);
    box-shadow: 0 2px 8px rgba(107, 255, 184, 0.3);
}

.home-icon {
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.2s ease;
}

.home-btn:hover .home-icon {
    color: var(--shg-accent);
}

.shg-sound-btn {
    background: rgba(15, 15, 40, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.shg-sound-btn:hover {
    background: rgba(107, 255, 184, 0.2);
}

.shg-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shg-title {
    font-size: 2.2rem;
    letter-spacing: 2px;
    background: linear-gradient(90deg, var(--shg-accent), var(--shg-accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.shg-subtitle {
    color: var(--shg-text-dim);
    font-size: 0.95rem;
}

.shg-main {
    display: flex;
    flex-direction: column;
    gap: var(--standard-spacing);
}

/* Stage: game + overlays stacked in the SAME grid cell */
.shg-stage {
    display: grid;
    border: 1px solid var(--shg-border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--shg-glass-bg);
    backdrop-filter: blur(4px);
}

.shg-stage > * {
    grid-area: 1 / 1;
}

/* Fullscreen button */
.shg-fs-btn {
    justify-self: end;
    align-self: start;
    z-index: 3;
    margin: 10px;
    background: rgba(15, 15, 40, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--shg-text);
    font-size: 1.1rem;
    line-height: 1;
    padding: 6px 10px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.shg-fs-btn:hover {
    background: rgba(107, 255, 184, 0.25);
}

.shg-stage:fullscreen {
    border: none;
    border-radius: 0;
    background: #030712;
    overflow-y: auto;
}

.shg-stage.fs-fallback {
    position: fixed;
    inset: 0;
    z-index: 999;
    border: none;
    border-radius: 0;
    background: #030712;
    overflow-y: auto;
}

/* Game area */
.shg-game {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 18px;
}

.shg-stage:fullscreen .shg-game,
.shg-stage.fs-fallback .shg-game {
    justify-content: center;
    min-height: 100%;
}

.shg-hud {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    letter-spacing: 1px;
    padding-right: 56px; /* fullscreen butonuyla çakışmasın */
}

.shg-hud-mode {
    color: var(--shg-accent);
    font-size: 0.85rem;
    text-transform: uppercase;
}

.shg-hud-round {
    color: var(--shg-text-dim);
    font-size: 0.85rem;
}

.shg-hud-score {
    color: var(--shg-accent-2);
    font-size: 1.3rem;
}

/* SVG scene: ship + tether + astronaut */
.shg-scene {
    width: min(100%, 460px);
    height: auto;
}

.shg-ship-body {
    fill: rgba(107, 255, 184, 0.15);
    stroke: var(--shg-accent);
    stroke-width: 2;
}

.shg-ship-window {
    fill: #06140E;
    stroke: var(--shg-accent);
    stroke-width: 2;
}

.shg-ship-engine {
    fill: rgba(255, 158, 107, 0.4);
    stroke: var(--shg-accent-2);
    stroke-width: 1.5;
}

.shg-tether-seg {
    stroke: var(--shg-accent-2);
    stroke-width: 3;
    stroke-dasharray: 6 4;
    transition: opacity 0.3s ease;
}

.shg-tether-seg.cut {
    opacity: 0.12;
}

.shg-astro-helmet {
    fill: rgba(234, 255, 244, 0.9);
}

.shg-astro-visor {
    fill: #0B2418;
}

.shg-astro-body {
    fill: rgba(234, 255, 244, 0.75);
}

.shg-astro-limb {
    stroke: rgba(234, 255, 244, 0.75);
    stroke-width: 4;
    stroke-linecap: round;
}

#astronaut {
    transition: transform 1.4s ease-in;
}

#astronaut.drift {
    transform: translate(60px, -34px) rotate(24deg);
    opacity: 0.5;
}

/* Lives (oxygen tanks) */
.shg-lives {
    display: flex;
    gap: 8px;
    font-size: 1.1rem;
    letter-spacing: 2px;
}

.shg-life {
    color: var(--shg-accent);
    text-shadow: 0 0 8px rgba(107, 255, 184, 0.7);
}

.shg-life.lost {
    color: rgba(234, 255, 244, 0.18);
    text-shadow: none;
}

/* Puzzle display: words as groups of letter slots (wraps nicely for sentences) */
.shg-puzzle {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 18px;
    max-width: 100%;
    padding: 4px 8px;
}

.shg-word {
    display: flex;
    gap: 5px;
}

.shg-slot {
    min-width: 22px;
    padding: 2px 1px;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--shg-text);
    border-bottom: 2px solid var(--shg-border);
    text-transform: uppercase;
}

.shg-slot.punct {
    border-bottom: none;
    color: var(--shg-text-dim);
    min-width: 12px;
}

.shg-slot.revealed {
    color: var(--shg-accent);
    text-shadow: 0 0 10px rgba(107, 255, 184, 0.6);
    border-bottom-color: var(--shg-accent);
}

.shg-slot.missed {
    color: var(--shg-accent-2);
    border-bottom-color: var(--shg-accent-2);
}

.shg-round-msg {
    min-height: 1.3em;
    font-weight: 700;
    color: var(--shg-accent);
    letter-spacing: 1px;
}

/* On-screen keyboard */
.shg-keyboard {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
    max-width: 560px;
}

.shg-key {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid var(--shg-border);
    background: rgba(3, 7, 18, 0.5);
    color: var(--shg-text);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.shg-key:hover:not(:disabled) {
    background: rgba(107, 255, 184, 0.2);
    transform: translateY(-1px);
}

.shg-key:disabled {
    cursor: default;
    opacity: 0.9;
}

.shg-key.hit {
    background: rgba(107, 255, 184, 0.3);
    border-color: var(--shg-accent);
    color: var(--shg-accent);
}

.shg-key.miss {
    background: rgba(255, 158, 107, 0.18);
    border-color: var(--shg-accent-2);
    color: var(--shg-accent-2);
    opacity: 0.55;
}

/* Overlays */
.shg-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(3, 7, 18, 0.7);
    z-index: 2;
}

.shg-overlay.hidden {
    display: none;
}

.shg-overlay-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: var(--shg-panel-bg);
    border: 1px solid var(--shg-border);
    border-radius: 12px;
    padding: 26px 34px;
    width: min(92%, 380px);
    text-align: center;
}

.shg-overlay-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--shg-accent);
    letter-spacing: 1px;
}

.shg-nick-label,
.shg-pick-label {
    font-size: 0.85rem;
    color: var(--shg-text-dim);
}

.shg-pick-label {
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.shg-nick-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--shg-border);
    background: rgba(3, 7, 18, 0.6);
    color: var(--shg-text);
    font-size: 1rem;
    text-align: center;
    outline: none;
}

.shg-nick-input:focus {
    border-color: var(--shg-accent);
}

.shg-nick-error {
    color: #FF8A8A;
    font-size: 0.8rem;
    min-height: 1em;
}

.shg-pick-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.shg-pick-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--shg-border);
    background: rgba(3, 7, 18, 0.5);
    color: var(--shg-text-dim);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.shg-pick-btn.active {
    background: rgba(107, 255, 184, 0.22);
    border-color: var(--shg-accent);
    color: var(--shg-accent);
}

.shg-reveal {
    font-size: 0.95rem;
    color: var(--shg-text-dim);
}

.shg-reveal b {
    color: var(--shg-accent);
}

.shg-final-score {
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--shg-accent-2);
}

.shg-submit-status {
    font-size: 0.9rem;
    color: var(--shg-text-dim);
    min-height: 1.2em;
}

.shg-btn {
    padding: 12px 32px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--shg-accent), var(--shg-accent-2));
    color: #04140C;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.shg-btn:hover {
    filter: brightness(1.15);
}

/* Leaderboard */
.shg-board-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shg-board-title {
    font-size: 1.2rem;
    color: var(--shg-accent);
    letter-spacing: 1px;
}

.shg-board-week {
    font-size: 0.85rem;
    color: var(--shg-text-dim);
    font-weight: 400;
}

.shg-board-container {
    background: var(--shg-glass-bg);
    backdrop-filter: blur(4px);
    border: 1px solid var(--shg-border);
    border-radius: 12px;
    padding: var(--standard-spacing);
}

.shg-board-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    counter-reset: rank;
}

.shg-board-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    border-radius: 8px;
    background: rgba(107, 255, 184, 0.06);
    counter-increment: rank;
}

.shg-board-list li::before {
    content: counter(rank);
    font-weight: 700;
    color: var(--shg-accent);
    min-width: 24px;
    text-align: right;
}

.shg-board-list li.shg-board-top1 {
    background: rgba(255, 209, 107, 0.12);
    border: 1px solid rgba(255, 209, 107, 0.45);
}

.shg-board-list li.shg-board-me {
    border: 1px solid var(--shg-accent-2);
}

.shg-board-nick {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shg-board-score {
    font-weight: 700;
    color: var(--shg-accent-2);
}

.shg-board-loading,
.shg-board-empty {
    color: var(--shg-text-dim);
    justify-content: center;
}

.shg-board-loading::before,
.shg-board-empty::before {
    content: '';
    min-width: 0;
}

.shg-board-note {
    font-size: 0.8rem;
    color: var(--shg-text-dim);
    text-align: center;
}

/* Footer */
.shg-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-bottom: var(--standard-spacing);
}

.shg-copyright {
    font-size: 0.75rem;
    color: var(--shg-text-dim);
}

/* Mobile */
@media (max-width: 767px) {
    .shg-title {
        font-size: 1.6rem;
    }

    .shg-overlay-card {
        padding: 18px;
        gap: 9px;
    }

    .shg-final-score {
        font-size: 2rem;
    }

    .shg-key {
        width: 34px;
        height: 40px;
        font-size: 0.9rem;
    }

    .shg-slot {
        min-width: 16px;
        font-size: 1rem;
    }
}
