/* ===== Reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* ===== Body (Game Pages) ===== */
body {
    color: rgba(255,255,255,0.8);
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

/* ===== Game Layout ===== */
.game-wrapper {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* ===== Game Title ===== */
.back-home {
    position: fixed;
    top: 16px;
    left: 20px;
    z-index: 50;
    color: rgba(255,255,255,0.25);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-decoration: none;
    transition: color 0.3s ease;
}
.back-home:hover {
    color: rgba(255,255,255,0.6);
}
.game-title {
    color: rgba(255,255,255,0.3);
    font-size: 1.5rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-shadow: 0 0 5px rgba(255,255,255,0.5);
    animation: breathing 10s ease-in-out infinite;
    cursor: default;
}
.game-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}
.game-title a:hover {
    color: rgba(255,255,255,0.6);
    text-shadow: 0 0 10px rgba(255,255,255,0.7);
}

/* ===== Game Info ===== */
.game-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 402px;
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
    letter-spacing: 0.12em;
}

/* ===== Game Controls ===== */
.game-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    animation: fadeIn 0.6s ease-in-out;
}
.game-controls select,
.game-controls button {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.6);
    font-family: inherit;
    font-size: 0.8rem;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.1em;
}
.game-controls select:hover,
.game-controls button:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.9);
}
.game-controls select option {
    background: #111;
    color: #ccc;
}

/* ===== Canvas ===== */
.game-board-container {
    position: relative;
}
canvas#gameCanvas {
    display: block;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(2px);
}

/* ===== Overlay ===== */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    gap: 16px;
    transition: opacity 0.3s ease;
}
.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
.overlay-title {
    color: rgba(255,255,255,0.5);
    font-size: 1.2rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}
.overlay-score {
    color: rgba(255,255,255,0.35);
    font-size: 0.9rem;
    letter-spacing: 0.12em;
}
.overlay-hint {
    color: rgba(255,255,255,0.4);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    animation: breathing 4s ease-in-out infinite;
    display: flex;
    align-items: center;
    gap: 0.4em;
}
.hint-key {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 3px;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.55);
    background: rgba(255,255,255,0.05);
    letter-spacing: 0.08em;
}
.overlay-controls {
    color: rgba(255,255,255,0.2);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    line-height: 1.8;
    text-align: center;
    margin-top: 8px;
}

/* ===== Mobile Controls ===== */
.mobile-controls {
    display: none;
}
.ctrl-btn {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.3);
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.ctrl-btn:active {
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.6);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .game-title { font-size: 1.8rem; }
    .mobile-controls { display: block; }
}
@media (max-width: 480px) {
    .game-title { font-size: 1.6rem; }
}
