body {
    margin: 0;
    overflow: hidden;
    background-color: #888;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* --- Dark Sidebar --- */
#ui-container {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 275px;
    color: #ccc;
    background: rgba(10, 10, 16, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 22px 18px;
    pointer-events: none;
    user-select: none;
    z-index: 50;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    box-sizing: border-box;
    transition: opacity 0.3s;
}

#ui-container.hidden {
    opacity: 0;
    pointer-events: none;
}

#ui-container h1 {
    margin: 0 0 2px 0;
    font-size: 22px;
    color: #c9a84c;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 12px rgba(201, 168, 76, 0.3);
}

#ui-container .subtitle {
    font-size: 11px;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
}

.section-sep {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 12px 0;
}

/* --- Tile Counts --- */
.tile-counts {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 8px 0 12px;
}

.tile-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px 8px 8px;
}

.tile-count-label {
    font-size: 9px;
    font-weight: bold;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tile-count-num {
    font-size: 28px;
    font-weight: bold;
    color: #ddd;
    line-height: 1.2;
}

.tile-count-sub {
    font-size: 9px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Turn indicator */
#turn-indicator {
    margin-top: 6px;
    padding: 7px 10px;
    text-align: center;
    border-radius: 6px;
    font-weight: bold;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: background 0.3s, color 0.3s;
}

/* Goal */
.goal-line {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 0 4px;
}

.goal-line .icon {
    font-size: 16px;
    margin-top: 2px;
}

.goal-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.goal-main {
    font-size: 12px;
    font-weight: bold;
    color: #e8d48b;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.goal-sub {
    font-size: 10px;
    color: #666;
    text-transform: none;
    letter-spacing: 0.5px;
}

/* Glass Icons */
.glass-icons-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 100;
    pointer-events: none;
    padding: 15px;
}

.glass-icons-container.top {
    top: 20px;
}

.glass-icons-container.bottom {
    bottom: 20px;
}

.glass-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    background: rgba(120, 120, 120, 0.55);
    border-radius: 8px;
    box-sizing: border-box;
    filter: drop-shadow(0 6px 8px rgba(0,0,0,0.6));
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.glass-icon.highlight {
    border-color: #ffcc00;
    background: rgba(255, 204, 0, 0.15);
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.4);
    transform: scale(1.1);
}

.glass-icon .sandwich {
    width: 100%;
    height: 16px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border-top: 4px solid;
    border-bottom: 4px solid;
}

.glass-icon .sandwich-inner {
    flex: 1;
    opacity: 0.6;
}

/* Removed quadrants */

/* White version icon */
.glass-icon-white .sandwich {
    border-color: #ffffff;
}
.glass-icon-white .sandwich-inner {
    background-color: #ccffff;
}
.glass-icon-white .q-bl {
    background-color: #000000;
}

/* Black version icon */
.glass-icon-black .sandwich {
    border-color: #000000;
}
.glass-icon-black .sandwich-inner {
    background-color: #4466aa;
}
.glass-icon-black .q-bl {
    background-color: #ffffff;
}

@keyframes popIn {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.goal-line .icon {
    font-size: 15px;
}

/* Actions header */
.actions-header {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #999;
    margin-bottom: 8px;
}

/* Action cards */
.action-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
}

.glass-preview {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    justify-content: center;
}

.action-card .glass-icon {
    transform: scale(0.85);
    margin: -4px;
    animation: none;
    opacity: 0.8;
}

.action-card .action-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: bold;
    color: #e0e0e0;
    margin-bottom: 5px;
}

.action-card .action-desc {
    font-size: 11px;
    color: #888;
    line-height: 1.5;
    margin: 0;
}

/* Spacer pushes bottom section down */
.sidebar-spacer {
    flex: 1;
}

/* Controls hint inside sidebar */
.controls-hint-inline {
    font-size: 10px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 10px;
}

.controls-hint-inline span {
    color: #777;
    font-weight: bold;
}

/* Restart button */
#ui-container button.restart-btn {
    pointer-events: auto;
    width: 100%;
    padding: 9px 0;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #888;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s;
}

#ui-container button.restart-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #bbb;
    border-color: rgba(255, 255, 255, 0.25);
}

/* Generic buttons */
button {
    pointer-events: auto;
    margin-top: 15px;
    width: 100%;
    padding: 10px 0;
    background: #000;
    border: none;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
}

button:hover:not(.side-btn):not(.restart-btn):not(.size-btn) {
    background: #333;
}

/* --- Side Selection Overlay --- */
#side-select-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 300;
    pointer-events: auto;
}

.landing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 600px;
    margin-bottom: 20px;
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.landing-content h1 {
    font-size: 56px;
    color: #c9a84c;
    text-transform: uppercase;
    letter-spacing: 8px;
    margin: 0 0 20px 0;
    text-shadow: 0 0 30px rgba(201, 168, 76, 0.4);
}

.goal-highlight {
    background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.15), transparent);
    padding: 15px 40px;
    margin-bottom: 20px;
    border-top: 1px solid rgba(201, 168, 76, 0.2);
    border-bottom: 1px solid rgba(201, 168, 76, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.goal-label {
    font-size: 11px;
    color: #c9a84c;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
}

.goal-text {
    font-size: 24px;
    color: #eee;
    font-weight: 300;
    text-align: center;
}

.goal-text .secondary {
    opacity: 0.5;
    font-size: 20px;
}

/* Board size picker */
.board-size-picker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.size-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
}

.size-options {
    display: flex;
    gap: 10px;
}

.size-btn {
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #999;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.2s;
    margin: 0;
    width: auto;
}

.size-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ddd;
    border-color: rgba(255, 255, 255, 0.3);
}

.size-btn.active {
    background: rgba(201, 168, 76, 0.2);
    color: #c9a84c;
    border-color: rgba(201, 168, 76, 0.5);
    box-shadow: 0 0 10px rgba(201, 168, 76, 0.15);
}

.choose-side-prompt {
    color: #666 !important;
    font-size: 14px !important;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px !important;
}

#side-select-overlay p {
    color: #aaa;
    font-size: 16px;
    margin-bottom: 40px;
}

.side-buttons {
    display: flex;
    gap: 40px;
}

.side-btn {
    width: 180px;
    height: 200px;
    border: 3px solid #555;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 20px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    gap: 16px;
}

.side-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.side-btn-white {
    background: linear-gradient(135deg, #f0f0f0, #cccccc);
    color: #111;
    border-color: #ddd;
}

.side-btn-white:hover {
    background: linear-gradient(135deg, #ffffff, #e0e0e0);
    border-color: #fff;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
}

.side-btn-black {
    background: linear-gradient(135deg, #333, #111);
    color: #eee;
    border-color: #555;
}

.side-btn-black:hover {
    border-color: #888;
    box-shadow: 0 0 30px rgba(100, 100, 255, 0.4);
}

.side-btn .piece-icon {
    font-size: 64px;
    line-height: 1;
}

.side-hint {
    color: #666;
    font-size: 13px;
    margin-top: 30px;
}

/* --- Game Over Overlay --- */
#game-over-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 140px;
    background: linear-gradient(to top, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0.8));
    display: none;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 40px;
    color: white;
    z-index: 45;
    pointer-events: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

#game-over-overlay h2 {
    font-size: 32px;
    margin: 0;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    letter-spacing: 2px;
}

#game-over-overlay button {
    width: auto;
    padding: 12px 30px;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    margin-top: 0;
}

#game-over-overlay button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* --- Proximity Glow Overlays --- */
.glow-overlay {
    position: absolute;
    left: 0;
    right: 0;
    height: 15vh;
    min-height: 100px;
    pointer-events: none;
    z-index: 40;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.glow-overlay.active {
    opacity: 1;
    animation: pulseGlow 2s infinite alternate ease-in-out;
}

#glow-top {
    top: 0;
    background: linear-gradient(to bottom, rgba(255, 30, 30, 0.4), transparent);
}

#glow-bottom {
    bottom: 0;
    background: linear-gradient(to top, rgba(135, 206, 235, 0.4), transparent);
}

@keyframes pulseGlow {
    0% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* --- Dev Menu --- */
#dev-menu {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 300px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 20px;
    color: #ccc;
    z-index: 1000;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    gap: 15px;
    font-family: monospace;
    box-sizing: border-box;
    pointer-events: auto;
}

#dev-menu.visible {
    transform: translateX(0);
}

#dev-menu h2 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #00ffff;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
    padding-bottom: 5px;
}

#dev-menu h3 {
    margin: 10px 0 5px 0;
    font-size: 14px;
    color: #aaa;
    text-transform: uppercase;
}

#dev-menu .subtitle {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 8px 0 4px;
}

.dev-control {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 12px;
}

.dev-control label {
    flex: 1;
}

.dev-control input[type="color"] {
    border: none;
    width: 30px;
    height: 20px;
    cursor: pointer;
    background: none;
    padding: 0;
}

.dev-control input[type="range"] {
    width: 100px;
    cursor: pointer;
}

.dev-control span {
    width: 30px;
    text-align: right;
    font-size: 10px;
    color: #888;
}

.section-group {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.02);
}

/* --- Photo Mode --- */
#photo-mode-panel {
    margin-bottom: 20px;
    pointer-events: auto; /* Allow clicking the photo mode controls */
}

#photo-mode-panel.hidden {
    display: none;
}

.photo-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px;
}

.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #ccc;
    font-weight: bold;
}

.control-row.hidden {
    display: none;
}

.control-row label {
    flex: 1;
}

.control-row input[type="color"], .control-row input[type="checkbox"] {
    cursor: pointer;
}

.control-row input[type="color"] {
    border: none;
    width: 24px;
    height: 18px;
    padding: 0;
    background: none;
    margin-left: 8px;
}

.color-preset-group {
    display: flex;
    gap: 4px;
    align-items: center;
}

button.color-preset {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: transform 0.1s, border-color 0.1s;
}

button.color-preset:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.6);
}

.rotate-group {
    display: flex;
    gap: 6px;
    flex: 2;
    align-items: center;
    justify-content: flex-end;
}

.rotate-group input[type="range"] {
    width: 60px;
    margin: 0;
    cursor: pointer;
}

.rotate-group button {
    margin: 0;
    padding: 0;
    font-size: 14px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #ccc;
    cursor: pointer;
    transition: all 0.2s;
}

.rotate-group button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    transform: none;
}

.radio-group {
    display: flex;
    gap: 6px;
    flex: 2;
    justify-content: flex-end;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
    font-weight: normal;
}

.radio-group label:hover {
    background: rgba(255, 255, 255, 0.1);
}

.radio-group input[type="radio"] {
    margin: 0;
    cursor: pointer;
}