/* theme-wordscn style.css */
/* /theme-wordscn/style.css */

/* 1. global styles */
*, *::before, *::after {
    box-sizing: border-box;
}

#controls, #controls * {
    user-select: none;
    -webkit-user-select: none;
}

body {
    background: #1a1a1a;
    color: rgb(212, 196, 183);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch; 
    height: 100vh;
    /* height: 100dvh; */
    overflow: hidden;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* --- sidebar & menu button --- */
#menu-toggle {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 2000;
    background: #8f3205;
    border: 2px solid #eee7ca;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    width: 36px;
    height: 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

#menu-toggle:hover {
    background: #8f3205; 
    border: 3px solid #eee7ca;
    color: #eee7ca;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
}

#menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: #d6d6d6;
}

.zoomButton0 {
    position: fixed;
    top:80px;
    right: 15px;
    z-index: 2000; 
    background: #909090d3;
    border: 2px solid #000000;
    border-radius: 1px;
    width: 30px;
    height: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    padding: 0;
    cursor: pointer;

    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.zoomButton1 {
    position: fixed;
    top:116px;
    right: 15px;
    z-index: 2000; 
    background: #909090d3;
    border: 2px solid #000000;
    border-radius: 1px;
    width: 30px;
    height: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    padding: 0;
    cursor: pointer;

    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.zoomButton2 {
    position: fixed;
    top:156px;
    right: 15px;
    z-index: 2000; 
    background: #909090d3;
    border: 0px solid #000000;
    border-radius: 0px;
    width: 30px;
    height: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    padding: 0;
    cursor: pointer;

    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.zoomButton0:hover { 
    background: #787878e6; 
    border: 3px solid #000000;
}

.zoomButton1:hover { 
    background: #787878e6; 
    border: 3px solid #000000;
}

.zoomButton2:hover { 
    background: #787878e6; 
    border: 1px solid #000000;
}

.saveButton {
    position: fixed;
    top:196px;
    right: 15px;
    z-index: 2000; 
    background: #909090d3;
    border: 2px solid #000000;
    border-radius: 1px;
    width: 30px;
    height: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    padding: 0;
    cursor: pointer;

    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.saveButton:hover { 
    background: #787878e6; 
    border: 3px solid #000000;
}

#sidebar {
    position: fixed;
    top: 0;
    right: -300px;
    width: 180px;
    height: 100%;
    background: #f4f4f4;
    border-left: 3px solid #000000;
    box-shadow: -5px 0 15px rgba(0,0,0,0.5);
    z-index: 2001;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

#sidebar.open {
    right: 0;
}

.sidebar-header {
    background: #e8e8e8;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 0.8rem;
    color: #000000;
}

#close-sidebar {
    background: transparent;
    border: none;
    color: #000000;
    font-size: 1rem;
    cursor: pointer;
}

.sidebar-content {
    padding: 12px;
    overflow-y: auto;
}

.menu-item {
    display: block;
    width: 100%;
    background: #fcfcfc;
    color: #000000;
    border: 2px solid #cccccc;
    padding: 8px;
    margin-bottom: 8px;
    text-align: left;
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 600;
}

.menu-item:hover {
    background: #e0e0e0;
    color: #000000;
    border: 3px solid #cccccc;
}

#open-themes {
    position: relative;
    padding-right: 34px;
}

#open-themes svg {
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    pointer-events: none;
}

.ig-link {
    display: flex;
    align-items: center;
    gap: 3px;
    color: #000000; 
    text-decoration: none;
    font-size: 0.75rem;
    margin-top: 20px;
    transition: opacity 0.2s ease;
    line-height: 1;
}

.ig-link svg {
    height: 1.1em; 
    width: 1.1em;
    fill: currentColor; 
    display: block;
    flex-shrink: 0;
    padding-right: 1px;
    box-sizing: content-box;
}

.ig-link:hover {
    opacity: 0.5;
}

.yt-link {
    display: flex;
    align-items: center;
    gap: 3px;
    color: #000000; 
    text-decoration: none;
    font-size: 0.75rem;
    margin-top: 12px; 
    transition: opacity 0.2s ease;
    line-height: 1;
}

.yt-link svg {
    height: 1.1em;
    width: 1.1em;
    fill: currentColor; 
    display: block;
    flex-shrink: 0;
    padding-right: 1px;
    box-sizing: content-box;
}

.yt-link:hover {
    opacity: 0.5;
}

/* --- modals (hovered windows) --- */
.modal-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-window {
    background: #f9f9f9;
    border: 5px solid #b4b4b4;
    padding: 20px;
    max-width: 300px;
    width: 90%;
    position: relative; /* important for the (x) position */
    color: #000000;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.modal-window h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #000000;
    text-transform: none;
}

/* This covers all (x) buttons in all modals */
.close-modal, 
#close-concept, 
#close-themes, 
#close-howtoplay, 
#close-projects, 
#close-about {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: #000000;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover,
#close-concept:hover,
#close-themes:hover {
    opacity: 0.5;
}

.modal-body {
    line-height: 1.2; /* space between lines */
    font-size: 0.8rem;
}

.modal-body p {
    margin: 0 0 10px 0;
}

.modal-body p:last-child {
    margin-bottom: 0;
}



#control-toggle {
    position: fixed;
    top: 335px;
    left: 3px;
    z-index: 2000; 
    background: #909090b2;
    border: 2px solid #000000;
    border-radius: 4px;
    width: 40px;
    height: 36px;
    min-width: 40px;
    min-height: 36px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

#control-toggle:hover {
    background: #d0d0d0; 
    border: 3px solid #000000;
    top: 334px;
    left: 3px;
    width: 48px;
    height: 40px;
}

#control-toggle svg {
    transform: scale(1.4);
    width: 20px; 
    height: 20px; 
    flex-shrink: 0; 
}


#controlBar {
    position: fixed;
    top: 215px;
    left: -300px;
    width: 170px;
    height: auto;
    max-height: 80vh; 
    background: #6c6c6c;

    border: 3px solid #000000;
    border-radius: 2px;
    z-index: 6001;
    transition: show 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

#controlBar.open {
    left: 15px;
}

#controlBar .sidebar-header {
    background: #6c6c6c;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#controlBar .sidebar-header h3 {
    margin: 0;
    font-size: 0.8rem;
    color: #000000;
}

#close-controlBar {
    background: transparent;
    border: none;
    color: #000000;
    font-size: 1rem;
    cursor: pointer;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.controlBar-content {
    padding: 12px;
    overflow-y: auto;
    flex: 1;
}

/* Control groups inside the settings panel */
.control-group {
    margin-bottom: 12px;
}

.control-label {
    display: block;
    font-size: 0.65rem;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
    font-weight: 600;
}

.control-select {
    display: block;
    width: 100%;
    background: #a9a9a9;
    color: #000000;
    border: 2px solid #212121;
    padding: 6px 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0;
    appearance: auto;
}

.control-select:hover {
    background: #e0e0e0;
    border-color: #d7d7d7;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.control-input {
    background: #b2b2b2;
    color: #000000;
    border: 2px solid #000000;
    padding: 6px 8px;
    font-size: 0.8rem;
    font-weight: 600;
    width: 60px;
    border-radius: 0;
    flex-shrink: 0;
}

.control-input--full {
    width: 100%;
    display: block;
    box-sizing: border-box;
}

.control-x {
    color: #000000;
    font-size: 0.8rem;
    flex-shrink: 0;
}



#theme-toggle {
    position: fixed;
    top: 280px;
    left: 2px;
    z-index: 2000; 
    background: #909090b2;
    border: 2px solid #000000;
    border-radius: 4px;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

#theme-toggle:hover {
    background: #d0d0d0; 
    border: 3px solid #000000;
    color: #fff;
    top: 279px;
    left: 2px;
    width: 48px;
    height: 44px;
}

#theme-toggle svg {
    transform: scale(1.3);
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.theme-header {
    background: #bfbfbf;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative; 
}

.theme-header h3 {
    margin: 0;
    font-size: 0.8rem;
    color: #000000;
}

#themeSelectPanel {
    position: fixed;
    top: 65px;
    left: -300px;
    width: 220px;
    height: auto;
    max-height: 80vh;
    background: #bfbfbf;

    border: 3px solid #ffffff; 
    border-radius: 2px;

    z-index: 6001;
    transition: show 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
}

#themeSelectPanel.open {
    left: 15px;
}

#close-themeSelectPanel {
    background: transparent;
    border: none;
    color: #000000;
    font-size: 1rem;
    cursor: pointer;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.theme-tile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
}

.theme-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    background: #c0c0c0;
    border: none;
    padding: 6px 6px 4px 6px;
    box-shadow:
        inset -2px -2px 0 #808080,
        inset 2px 2px 0 #ffffff;
    transition: filter 0.15s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.theme-tile:hover:not(.current-theme) {
    filter: brightness(0.6);
}

.theme-tile:active:not(.current-theme) {
    box-shadow:
        inset 2px 2px 0 #808080,
        inset -1px -1px 0 #ffffff;
}

.theme-tile.current-theme {
    filter: brightness(0.65);
    cursor: default;
    pointer-events: none;
    box-shadow:
        inset 1px 1px 0 #808080;
}

.theme-preview {
    width: 80px;
    height: 80px;
    image-rendering: pixelated;
    display: block;
}

.theme-tile-label {
    margin-top: 5px;
    font-size: 0.6rem;
    font-weight: 700;
    color: #000000;
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.2;
}


#controls {
    padding: 10px;
    background: #e5dcca;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    border-bottom: none;
    flex-wrap: wrap;
    align-content: center; /* Added to keep rows tight */
    box-sizing: border-box;
    flex-shrink: 0;
}

.faceEmoji {
    position: flex;
    background: #e5dcca; 
    border: 2px solid #e5dcca;
    border-radius: 1px;
    width: 35px;
    height: 34px;
    margin: 0 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    padding: 0;
    cursor: pointer;

    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.faceEmoji:hover { 
    background: rgb(255, 247, 233); 
    border: 0;
}

.faceEmoji svg {
    pointer-events: none;
}

#mineDisplay, #timeDisplay {
    min-width: 80px; /* Ensures both sides have equal 'weight' */
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px; 
}

button {
    background: #000000;
    color: rgb(212, 196, 183);
    border: 1px solid #d4c4b7;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 1px;
    transition: background 0.2s, color 0.2s;
    font-weight: normal;
    font-size: 0.7rem;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;

    width: auto;
    flex-grow: 0;
    flex-shrink: 0;
}

button:hover { 
    background: #444; 
    color: #fff;
}


/* 3. game viewport */
#canvas-container {
    flex: 1; 
    /* width: 100%; */ 
    overflow: auto;
    background: #e5dcca;
    
    display: grid; /* flex */ 
    /* flex-direction: column; */
    /*place-items: start center; Centers horizontally, starts at top */
    align-items: center; 

    /* padding: 20px 0; */ 
    position: relative; 
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

/* 4. canvas wrapper */
#canvas-wrapper {
    display: inline-block;
    position: relative;
    margin: auto; 
    transition: transform 0.4s ease;
    transform-origin: center center;
}

/* 5. canvas styles */
#canvas-container canvas {
    margin-top: 20px; 
    margin-bottom: 20px;
    display: block; 
    
    image-rendering: pixelated; /* Keeps it from getting blurry */
    touch-action: manipulation;

    user-select: none;
    background: transparent !important;
    /* Use width/height transition instead of transform */
    transition: width 0.2s ease-in-out, height 0.2s ease-in-out;
}

#canvas-container canvas.zoomed {
    /* handle the specific width/height in JS to ensure it matches dynamic grid size */
    margin-top: 40px; 
    margin-bottom: 100px;
}


/* sidebar footer */
.sidebar-footer {
    margin-top: auto;
    padding: 10px;
    border-top: 1px solid #ddd;
    background: #e8e8e8;
}

.sidebar-footer p {
    margin: 0 0 6px 0;
    font-size: 0.5rem;
    color: #666;
    line-height: 1.4;
}

.sidebar-footer .copyright {
    font-size: 0.5rem;
    color: #000;
    font-weight: bold;
}


/* ── cassette / FM radio ── */
#radioPlayer {
    position: fixed;
    bottom: -220px;
    left: -36px;
    width: fit-content;
    height: fit-content;
    overflow: visible;
    font-family: sans-serif;
    user-select: none;
    -webkit-touch-callout: none;
    z-index: 5000;
    cursor: default;
    pointer-events: none;
    will-change: transform; /* promotes to compositor layer — prevents full-page repaints on drag */
}

#bb-drag-handle {
    position: absolute;
    top: -10px;
    right: 22%;
    width: 54%;
    height: 30px;
    background: #4b1e1c;
    border: 3px solid #3c0706; 
    
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bca990;
    cursor: grab;
    z-index: 10;
    transition: background 0.15s, color 0.15s;
}

#bb-drag-handle:hover {
    background: #6a2926;
    color: #bca990;
}

#bb-drag-handle:active {
    cursor: grabbing;
    background: #6a2926;
    color: #3c0706;
}

/* OUTER SHELL */
.bb-shell {
    background: linear-gradient(160deg, #d4c0a8 0%, #bca990 35%, #a89278 70%, #c8b49a 100%);
    box-shadow: 
        4px 8px 16px 4px rgba(0,0,0,0.7),
        inset 0 1px 0 rgba(255,255,255,0.7),
        inset 0 -2px 4px rgba(0,0,0,0.3);
    border-top: none; 
    border-radius: 18px 18px 12px 12px;
    padding: 0 0 7px 0;
    position: relative;
    width: 100%;
    overflow: visible;
    transform: scale(0.741);
    transform-origin: top left;
    pointer-events: auto;
    contain: layout style; /* internal changes don't trigger recalc on the rest of the document */
}

.bb-antenna {
    position: absolute;
    left: 44px;
    top: -49px;
    width: 5px;
    height: 58px;
    background: linear-gradient(to right, #b7b7b7, #727272, #a9a9a9);
    border-radius: 3px 3px 2px 2px;
    transform-origin: bottom center;
    transform: rotate(30deg);
    z-index: 4999;
    pointer-events: none;
}
.bb-antenna::before {
    /* base ball joint */
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #a0a0a0, #5e5e5e);
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.bb-antenna::after {
    /* tip ball */
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #a9a9a9, #6e6e6e);
}


/* KNOBS ROW */
.bb-knobs {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 5px 14px 4px;
}
.bb-knob {
    width: 8px;
    height: 12px;
    background: linear-gradient(to bottom, #ffdea5, #937541);
    border-radius: 3px;
    box-shadow: 0px 1px 4px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.3);
    cursor: pointer;
    transition: transform 0.1s;
}

.bb-knob:active { transform: scaleY(0.9); }
.bb-knob-group { display: flex; gap: 5px; }

.bb-knob-small {
    width: 7px;
    height: 10px;
    background: linear-gradient(to bottom, #ffdea5, #937541);
    border-radius: 2px;
    box-shadow: 0px 0px 2px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.3);
}
.bb-knob-small:hover { transform: scaleY(0.9); }

.bb-knob-group-right { display: flex; gap: 4px; align-items: flex-end; }

.bb-knob.bb-knob-power {
    width: 16px;
    height: 15px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1px 1px 0;
    overflow: hidden;
}
.bb-knob.bb-knob-power svg {
    width: 12px;
    height: 12px;
    display: block;
    fill: #6b4e1a;
    padding-bottom: 1px; 
}

/* TOP RED SECTION */
.bb-top {
    background: #6a2926;
    border: 1px solid #472624; 
    margin: 0 8px;
    border-radius: 4px;
    padding: 3px;
    display: flex;
    gap: 6px;
    align-items: stretch;
}

/* Tuner/radio strip */
.bb-tuner {
    flex: 1;
    background: #111;
    border-radius: 3px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 3px 4px;
    cursor: grab;
}
.bb-tuner-stripe {
    height: 7px;
    background: repeating-linear-gradient(to right, #2a2a2a 0px, #2a2a2a 8px, #1a1a1a 8px, #1a1a1a 10px);
    border-radius: 1px;
}
.bb-tuner-needle {
    position: absolute;
    top: 0; bottom: 0;
    left: 55%;
    width: 4px;
    background: rgb(224, 22, 0);
    cursor: grab;
    z-index: 5;
    user-select: none;
    touch-action: none;
    box-shadow: 0 0 8px rgba(224, 80, 0, 3.9);
}
.bb-tuner-needle:active { cursor: grabbing; }

.bb-tuner-tick {
    position: absolute;
    top: 2px; bottom: 2px;
    width: 1px;
    background: rgba(255, 200, 80, 0.35);
    pointer-events: none;
    transition: background 0.2s;
}
.bb-tuner-tick.active {
    background: rgba(255, 200, 80, 0.9);
    box-shadow: 0 0 3px rgba(255,200,80,0.6);
}

/* MAIN BODY */
.bb-body {
    background-color: rgb(89, 21, 19);
    background-image: radial-gradient(rgba(0,0,0,0.2) 1px, transparent 2px);
    background-size: 2.5px 4px;
    margin: 4px 8px 0;
    border-radius: 4px;
    border: 2px solid #270e0e; 
    box-shadow: inset 0 3px 8px rgba(0,0,0,0.4), inset 0 -1px 3px rgba(0,0,0,0.3);
    padding: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Large speakers */
.bb-speaker {
    width: 78px;
    height: 78px;
    flex-shrink: 0;
    border-radius: 50%;
    box-shadow: 
        inset 0 3px 6px rgba(0,0,0,0.6),
        0 2px 4px rgba(255,255,255,0.08);
    background: radial-gradient(circle at center, #2a2a2a 0%, #380000 65%, #000 100%);
    display: grid;
    place-items: center;
}

.bb-speaker-inner {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle at 45% 40%, #000000 0%, #2e2e2e 45%, #2a2a2a 85%, #000000 100%);
    display: grid;
    place-items: center;
    border: 3px solid #1a1a1a;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.25);
}

.bb-speaker-center {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 30%, #3a3a3a 0%, #2e2e2e 50%, rgb(59, 59, 59) 100%);
    border: 1px solid #1e1e1e;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.bb-speaker-center:active {
    background: radial-gradient(circle at 60% 70%, #3a3a3a 0%, #2e2e2e 50%, rgb(59, 59, 59) 100%);
    border: 0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.7), inset 0 1px 2px rgba(0,0,0,0.5);
    cursor: pointer;
}

/* CENTER CONTROLS */
.bb-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Cassette / iframe area */
.bb-cassette {
    background: #390000;
    border-radius: 4px;
    border: 2px solid #310000;
    overflow: hidden;
    width: 150px;
    height: 150px;
    display: flex;
    align-items: stretch;
    justify-content: center;
    position: relative;
}
.bb-cassette iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}
.bb-cassette-panel {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.bb-cassette-panel iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}
/* height = cassette_height / scale, width = 100% / scale */
#bb-radio-iframe {
    position: absolute;
    top: -4px; left: -1px;
    width: 110%;
    height: 185px;
    transform: scale(0.92);
    transform-origin: top left;
    border: 0;
}
.bb-station-display {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}
.bb-station-lcd {
    background: #140908;
    border: 1px solid #3a1d19eb;
    border-radius: 3px;
    width: 100%;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    box-shadow: inset 0 0 12px rgba(0,0,0,0.6);
}
.bb-station-name {
    color: #e8a840;
    font-family: 'Courier New', monospace;
    font-size: 0.65rem;
    font-weight: bold;
    letter-spacing: 0.08em;
    text-align: center;
    text-shadow: 0 0 6px rgba(212,170,48,0.5);
    text-transform: uppercase;
}
.bb-station-freq {
    color: #e8b640;
    font-family: 'Courier New', monospace;
    font-size: 1.4rem;
    font-weight: bold;
    letter-spacing: 0.1em;
    text-shadow: 0 0 10px rgba(232,200,64,0.7);
}
.bb-station-status {
    color: #7a6010;
    font-family: 'Courier New', monospace;
    font-size: 0.55rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.bb-station-status.playing  { color: #90b840; text-shadow: 0 0 4px rgba(144,184,64,0.5); }
.bb-station-status.buffering { color: #d4aa30; }
.bb-station-status.error    { color: #c04020; }

/* Dial glows orange when in radio mode */
#bb-mode-dial.radio-mode {
    box-shadow: 0 0 6px rgba(224, 80, 0, 0.7);
    background: radial-gradient(circle at 35% 35%, #f0c080, #c07030);
    transform: rotate(36deg);
}
#bb-mode-dial.radio-mode:active {transform: rotate(110deg);}


/* BOTTOM RED STRIP */
.bb-bottom {
    background: rgb(102, 25, 21);
    border: 2px solid #321c1c; 
    margin: 4px 8px 0;
    border-radius: 3px;
    box-shadow: inset 0 2px 3px rgba(0,0,0,0.3), 0 1px 0 rgba(255,255,255,0.6);
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Round buttons */
.bb-roundbtn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(0, 0, 0, 0.4);
    box-shadow: 
        0 3px 5px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.3),
        inset 0 -1px 2px rgba(0,0,0,0.3);
    transition: filter 0.1s, transform 0.1s;
    flex-shrink: 0;
}
.bb-roundbtn:active { 
    transform: scale(0.98); 
    filter: brightness(0.9); 
    border: 3px solid rgba(0, 0, 0, 0.4);
    box-shadow: 
        0 2px 2px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.3),
        inset 0 -1px 2px rgba(0,0,0,0.3);
}
.bb-roundbtn.yellow  { background: radial-gradient(circle at 35% 35%, #ded0ad, #fde5a7); }
.bb-roundbtn.yellow.big { width: 30px; height: 30px; }

.bb-roundbtn svg {
    width: 100%;
    height: 100%;
    display: block;
    margin: auto;
    pointer-events: none;
}

/* Square buttons */
.bb-sqbtn-group { display: flex; gap: 2px; }
.bb-sqbtn {
    width: 28px;
    height: 27px;
    border-radius: 1px;
    cursor: pointer;
    border: 2px solid rgba(0,0,0,0.4);
    transition: filter 0.1s;
}
.bb-sqbtn:active { filter: brightness(0.8); }
.bb-sqbtn.sq-yellow { background: #f0b800; }
.bb-sqbtn.sq-blue   { background: #2196c9; }
.bb-sqbtn.sq-red    { background: #e74c3c; }

.bb-sqbtn:hover {filter: brightness(1.3);}

/* Big dial knob */
.bb-dial {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fff6da, #928464);
    border: 2px solid rgba(0,0,0,0.5);
    cursor: pointer;
    position: relative;
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.2s;
}
.bb-dial::after {
    content: '';
    position: absolute;
    top: 3px; left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 10px;
    background: rgba(0,0,0,0.5);
    border-radius: 2px;
}
.bb-dial:active { transform: rotate(80deg); }

/* spacer */
.bb-sp { flex: 1; }


/* mobile */
@media (max-width: 768px) {
    #controls { 
        padding: 8px 5px; 
        gap: 8px; 
        justify-content: center;
    }    
    button { 
        padding: 8px 10px; 
        flex-grow: 0; 
        width: auto; 
        max-width: none; 
    }    
    #canvas-container {
        padding: 30px 10px;
    }
}

@media (max-width: 500px) {
    #radioPlayer {
        bottom: -200px;
        left: -100px;
    }
}

@media (max-width: 400px) {
    #controls {
        gap: 5px;
        padding: 5px;
    }
    input[type="number"] { width: 45px; } /* Shrink inputs slightly for tiny screens */
}

/* ── end game pop-up ── */
.end-popup-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    pointer-events: none;
}

.end-popup-window {
    pointer-events: all;
    width: 180px;
    background: #ece9d8;
    border: 1px solid #0a246a;
    box-shadow: inset 0 0 0 1px #a4b4d4, 3px 3px 8px rgba(0,0,0,0.5);
    font-family: Tahoma, 'MS Sans Serif', Arial, sans-serif;
    animation: popup-drop 0.15s cubic-bezier(.22,.68,0,1.15) both;
}

@keyframes popup-drop {
    from { transform: translateY(-14px) scale(0.95); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* ── Title bar ── */
.end-popup-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 4px 3px 6px;
    background: linear-gradient(to bottom, #0f4ece 0%, #3a7bd5 40%, #245fcc 60%, #1a52c2 100%);
    border-bottom: 1px solid #0a246a;
    user-select: none;
}

.end-popup-titlebar-left {
    display: flex;
    align-items: center;
    gap: 5px;
}

.end-popup-titlebar-icon {
    width: 16px;
    height: 16px;
    image-rendering: pixelated;
}

.end-popup-title {
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    letter-spacing: 0;
}

/* ── X button ── */
.end-popup-close {
    width: 21px;
    height: 21px;
    font-size: 10px;
    line-height: 1;
    color: #000;
    background: linear-gradient(to bottom, #f0f0ea, #d4d0c8);
    border: 1px solid #888;
    border-top-color: #fff;
    border-left-color: #fff;
    box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #888;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Marlett, 'Courier New', monospace;
}
.end-popup-close:active {
    background: linear-gradient(to bottom, #d4d0c8, #f0f0ea);
    border-top-color: #888;
    border-left-color: #888;
    border-bottom-color: #fff;
    border-right-color: #fff;
}

/* ── Body ── */
.end-popup-body-wrap {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px 14px 16px;
    background: #ece9d8;
}

.end-popup-icon {
    font-size: 2.2rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.end-popup-body {
    font-size: 11px;
    color: #000;
    line-height: 1.6;
    flex: 1;
}

.end-popup-body strong {
    display: block;
    font-size: 12px;
    margin-bottom: 5px;
}

.end-popup-body strong.is-gameover { color: #a00000; }
.end-popup-body strong.is-win      { color: #005500; }

/* ── Footer ── */
.end-popup-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 16px 12px;
    gap: 8px;
    border-top: 1px solid #aca899;
    background: #ece9d8;
}

/* ── OK / New Game button ── */
.end-popup-btn {
    min-width: 75px;
    height: 23px;
    font-family: Tahoma, 'MS Sans Serif', Arial, sans-serif;
    font-size: 11px;
    color: #000;
    background: linear-gradient(to bottom, #f4f2ec, #dbd8cc);
    border: 1px solid #888;
    border-top-color: #fff;
    border-left-color: #fff;
    box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #888, 1px 1px 2px rgba(0,0,0,0.2);
    cursor: pointer;
    padding: 0 12px;
}

.end-popup-btn:hover {
    background: linear-gradient(to bottom, #f9f8f4, #e8e4d8);
}

.end-popup-btn:active {
    background: linear-gradient(to bottom, #dbd8cc, #f4f2ec);
    border-top-color: #888;
    border-left-color: #888;
    border-bottom-color: #fff;
    border-right-color: #fff;
    box-shadow: inset 1px 1px 0 #888;
    transform: translate(1px, 1px);
}


.pencil { 
    border: 0 solid blue; 
    box-sizing: border-box; 
    width: 37.2em;           /* fixed length — does not change with window size */
    height: 2em; 
    line-height: 2em;
    margin: 0;
    position: fixed;       /* positioned relative to viewport, to the right of the canvas */

    clip-path: polygon(0% 45%, 0 55%, 4em 100%, 100% 100%, 100% 0%, 4em 0%);

    border-top-right-radius: 0.5em;
    border-bottom-right-radius: 0.5em;
    overflow: hidden;
}

/* individual pencil positions and angles */
#pencil-yellow {
    top: 420px;
    right: -172px;
    transform: rotate(82deg);
    transform-origin: center center;
}

#pencil-green {
    top: 340px;
    right: -208px;
    transform: rotate(84deg);
    transform-origin: center center;
}
.pencil:before {
    position: absolute;
    left: 0em;
    top: 0px;
    content: "";
    width: 4em;
    height: 2em;
    z-index: 2;
    background:
        /* Shading to fake the conical look */
        linear-gradient(5deg,   rgba(0,0,0,0.12) 0%, rgba(0,0,0,0.05) 30%, rgba(0,0,0,0) 48%, rgba(0,0,0,0) 100%),
        linear-gradient(175deg, rgba(0,0,0,0.06) 0%, rgba(0,0,0,0)    30%, rgba(0,0,0,0) 48%, rgba(0,0,0,0) 100%),
        /* black graphite lead 0→19%, dark transition 19→22%, cedar wood body 22→85% */
        linear-gradient(80deg,
            #1c1c1c          0%,
            #242420          12%,
            #3a3020          19%,
            rgba(0,0,0,0)    21%,
            rgb(120, 65, 22)  22%,
            rgb(152, 90, 36)  38%,
            rgb(182, 116, 52) 55%,
            rgb(198, 130, 62) 70%,
            rgb(172, 102, 42) 82%,
            rgba(0,0,0,0)    86%),
        /* rounded wood end — cedar palette */
        radial-gradient(circle farthest-corner at 90% 15%, rgba(185, 112, 44, 0.92) 0.35em, rgba(255,255,255,0) 0),
        radial-gradient(circle farthest-corner at 85% 50%, rgba(198, 128, 58, 1.00) 0.65em, rgba(255,255,255,0) 0),
        radial-gradient(circle farthest-corner at 90% 85%, rgba(180, 106, 40, 0.90) 0.35em, rgba(255,255,255,0) 0);
}
.pencil:after {
    box-sizing: border-box;
    position: absolute;
    content: "";
    display: block;
    right: 0;
    top: 0;
    width: 5em;
    height: 2em;
    background:
        /* cylinder shading: bright specular top, shadow bottom */
        linear-gradient(to bottom,
            rgba(255,255,255,0.58) 0%,
            rgba(255,255,255,0.26) 18%,
            rgba(255,255,255,0.03) 46%,
            rgba(0,0,0,0.00)       54%,
            rgba(0,0,0,0.18)       80%,
            rgba(0,0,0,0.42)       100%),
        /* color bands left→right:
           dark seam | gold ferrule 1 | crimson band | gold ferrule 2 | eraser */
        linear-gradient(to right,
            rgba(0,0,0,0.32) 0em,     rgba(0,0,0,0.32) 0.05em,
            /* ferrule 1 — 3 bright rings in 1.0em */
            #A86C10 0.36em,
            #CC9018 0.51em, #FCCF38 0.57em, #FFE060 0.61em, #FCCF38 0.65em, #CC9018 0.71em,
            #906010 0.79em,
            #CC9018 0.85em, #FCCF38 0.91em, #FFE060 0.95em, #FCCF38 0.99em, #CC9018 1.05em,
            #906010 1.13em,
            #CC9018 1.19em, #FCCF38 1.25em, #FFE060 1.29em, #FCCF38 1.32em, #CC9018 1.38em,
            #A86C10 1.50em,
            /* crimson band — unchanged */
            #6A0810 1.50em, 
            #8A1018 1.54em, 
            #780C14 1.65em, 
            #6b0808 1.94em, 
            #780C14 2.27em, 
            #8A1018 2.36em, 
            #6A0810 2.40em,
            /* ferrule 2 — 2 bright rings in 0.85em */
            #A86C10 2.40em,
            #CC9018 2.52em, #FCCF38 2.58em, #FFE060 2.62em, #FCCF38 2.66em, #CC9018 2.72em,
            #906010 2.82em,
            #CC9018 2.88em, #FCCF38 2.94em, #FFE060 2.98em, #FCCF38 3.02em, #CC9018 3.10em,
            #A86C10 3.18em,
            #CC9018 3.24em, #FCCF38 3.30em, #FFE060 3.34em, #FCCF38 3.38em, #CC9018 3.46em,
            #A86C10 3.84em,
            /* eraser */
            #EDE9E5 3.84em, #E6E0D9 4.45em,
            #DAD2CA 4.82em, #D2C9C0 5.00em
        );
}
 

.pencil .label { 
    border: 0 solid red; 
    box-sizing: border-box;
    width: 100%;
    height: 2em;
    line-height: 2em;
    padding: 0 5.5em 0 0.5em;   /* right padding matches :after width + small gap */
    
    white-space: nowrap;
    text-overflow: "";
    text-align: right;
    text-shadow: 1px 1px 1px rgba(255,255,255,0.5), -1px -1px 1px rgba(0,0,0,0.2);
    
    color: #967915;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%,rgba(0,0,0,0.1) 22%, rgba(0,0,0,0) 25%, rgba(0,0,0,0.1) 30%, rgba(0,0,0,0) 70%, rgba(0,0,0,0.3) 75%);
    position: relative;
}

/* "國小功課都不寫" — left side of pencil body, font-size 0.75em so both texts fit */
.pencil .label:before {
    position: absolute;
    left: 5.5em; /* 5.5 × 0.75em ≈ 4.1em in parent = just past the tip */
    top: 50%;
    transform: translateY(-50%);
    content: "國小功課都不寫";
    font-size: 0.75em;
    white-space: nowrap;
    color: #967915;
    text-shadow: 1px 1px 1px rgba(255,255,255,0.4), -1px -1px 1px rgba(0,0,0,0.15);
}

.pencil .label:after {
    position: absolute;
    left: 22.5em;             /* 12.5 × 0.75em ≈ 9.4em in parent = right after 7 chars */
    top: 50%;
    transform: translateY(-50%);
    content: "跑去踩地雷";
    font-size: 0.75em;
    white-space: nowrap;
    color: #967915;
    text-shadow: 1px 1px 1px rgba(255,255,255,0.4), -1px -1px 1px rgba(0,0,0,0.15);
}

#pencil-green .label {
    color: #967915;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.4), -1px -1px 1px rgba(0,0,0,0.2);
}
#pencil-green .label::before,
#pencil-green .label::after {
    color: #967915;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.4), -1px -1px 1px rgba(0,0,0,0.2);
}

/* Positioning Wrapper - Using the "Pencil Method" */
#eraser_wrapper {
    position: absolute;
    top: 360px; 
    left: 50px;
    width: 200px; 
    height: 80px;
    transform: rotate(110deg); 
    transform-origin: center;
}

/* The White Eraser Head */
#eraser_head {
    position: absolute;
    top: 2px;
    left: -62px;
    width: 50px;
    height: 76px;

    border-radius: 10px 6px 6px 10px;
    z-index: 0;
    box-shadow: 2px 3px 6px rgba(0,0,0,0.12);

    /* Button reset */
    border: none;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;

    /* Center the face SVG */
    display: flex;
    align-items: center;
    justify-content: center;

    background-color: #ededed;
    background-image:
        radial-gradient(ellipse 28px 18px at 8px 38px,  rgba(80,80,80,0.30) 0%, transparent 100%),
        radial-gradient(ellipse 20px 12px at 12px 18px, rgba(70,70,70,0.22) 0%, transparent 100%),
        radial-gradient(ellipse 10px 8px  at 4px  65px, rgba(50,50,50,0.35) 0%, transparent 80%),
        radial-gradient(ellipse 22px 10px at 18px 58px, rgba(90,90,90,0.15) 0%, transparent 100%),
        radial-gradient(ellipse 12px 10px at 3px   8px, rgba(60,60,60,0.20) 0%, transparent 100%),
        radial-gradient(ellipse 16px 8px  at 22px 30px, rgba(100,100,100,0.10) 0%, transparent 100%),
        radial-gradient(ellipse 14px 6px  at 6px  68px, rgba(70,70,70,0.18) 0%, transparent 100%);
}
#eraser_head:hover {
    background-color: #ffffff;
    box-shadow: 3px 4px 8px rgba(0,0,0,0.18);
}

/* Counter-rotate the face so it stays upright on the tilted eraser */
#eraser_head svg {
    transform: rotate(-110deg);
    flex-shrink: 0;
}


/* The White Eraser Head */
/* #eraser_wrapper::before {
    content: "";
    position: absolute;

    top: 2px;
    left: -40px;

    width: 50px;
    height: 76px;

    border-radius: 17px 6px 6px 20px;
    z-index: -1;
    box-shadow: 2px 3px 6px rgba(0,0,0,0.12);

    background-color: #ededed;
    background-image:
        /* === GRAPHITE SMUDGE PATCHES === */
        /* Large main smear across the tip face */ /* 
        radial-gradient(ellipse 28px 18px at 8px 38px,  rgba(80,80,80,0.30) 0%, transparent 100%),
        /* Secondary smudge, offset upward */ /* 
        radial-gradient(ellipse 20px 12px at 12px 18px, rgba(70,70,70,0.22) 0%, transparent 100%),
        /* Small concentrated dark spot — heavy use point */ /* 
        radial-gradient(ellipse 10px 8px  at 4px  65px, rgba(50,50,50,0.35) 0%, transparent 80%),
        /* Faint wide smear toward middle of eraser */ /* 
        radial-gradient(ellipse 22px 10px at 18px 58px, rgba(90,90,90,0.15) 0%, transparent 100%),
        /* Corner grime, top-left */ /* 
        radial-gradient(ellipse 12px 10px at 3px  8px,  rgba(60,60,60,0.20) 0%, transparent 100%),
        /* Faint residue mid-body */ /* 
        radial-gradient(ellipse 16px 8px  at 22px 30px, rgba(100,100,100,0.10) 0%, transparent 100%),
        /* Streak smear near bottom tip */ /* 
        radial-gradient(ellipse 14px 6px  at 6px  68px, rgba(70,70,70,0.18) 0%, transparent 100%);
} */ 

/* The Eraser Body */
.mono_eraser {
    position: relative;
    width: 100%;
    height: 100%;
    /* Blue, White, and Black stripes */
    background: linear-gradient(to bottom, 
        #0035ad 0%, #0035ad 33%, 
        #ffffff 33%, #ffffff 66%, 
        #000000 66%, #000000 100%
    );
}
/* The "MONO" Logo */
.mono_eraser::before {
    content: "MINESWEEPER";
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Arial Black", sans-serif;
    font-size: 24px;
    font-weight: 900;
    color: #000;
    letter-spacing: -1px;
    z-index: 2;
    border-radius: 2px;
    box-shadow: 3px 5px 10px rgba(0,0,0,0.1);
}
/* The Top and Bottom Labels */
.mono_eraser::after {
    /* \A is a CSS line break. We use pre-wrap to respect it. */
    /* Adjust spaces between the Japanese text and E-30N to fit width */
    content: "仙人拍鼓有時錯，跤步踏差啥人無？      橡皮擦 \A \A \A \A \A click eraser face to start new game";
    white-space: pre;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 6px 10px;
    box-sizing: border-box;
    
    /* Label Text Styling */
    color: #fff;
    font-family: "Helvetica", "Arial", sans-serif;
    font-size: 9px;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none; /* Allows clicks to pass through to the div */
}

/* G-SHOCK DW-5600 */
#gshock {
    position: fixed;
    top: 20px;
    left: -10px;
    transform: rotate(-20deg);
    transform-origin: top left;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 50;
    pointer-events: none;
    width: 158px;
}

/* Straps */
.gs-strap {
    width: 102px;
    background: #212121;
    position: relative;
}
.gs-strap-top {
    height: 36px;
    border-radius: 6px 6px 0 0;
    border: 1px solid #252525;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    box-shadow: inset 0 3px 5px rgba(255,255,255,0.03);
}
.gs-strap-bot {
    height: 48px;
    border-radius: 0 0 8px 8px;
    border: 1px solid #252525;
    border-top: none;
    padding: 8px 16px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
}
.gs-stud {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 32%, #303030, #0e0e0e);
    box-shadow: 0 1px 3px rgba(0,0,0,0.9), inset 0 1px 1px rgba(255,255,255,0.05);
}
.gs-stud-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
}
.gs-holes {
    display: flex;
    gap: 7px;
}
.gs-holes span {
    width: 5px;
    height: 9px;
    border-radius: 2px;
    background: #202020;
    box-shadow: inset 0 1px 3px rgba(0,0,0,1);
}

/* Case shell (contains face + floating buttons) */
.gs-case-shell {
    width: 158px;
    position: relative;
    flex-shrink: 0;
}

/* Side buttons */
.gs-btn {
    position: absolute;
    background: linear-gradient(to bottom, #2c2c2c, #141414);
    border-radius: 3px 2px 2px 3px;
    box-shadow: 
        0 2px 5px rgba(0,0,0,0.9),
        inset 0 1px 0 rgba(255,255,255,0.06),
        inset 0 -1px 0 rgba(0,0,0,0.4);
}
.gs-btn-l1, .gs-btn-l2 {
    left: -13px;
    width: 15px;
    border-radius: 2px 3px 3px 2px;
}
.gs-btn-l1 { top: 36px; height: 26px; }
.gs-btn-l2 { top: 106px; height: 22px; }

.gs-btn-r1, .gs-btn-r2 {
    right: -13px;
    width: 15px;
}
.gs-btn-r1 { top: 38px; height: 22px; }
.gs-btn-r2 { top: 104px; height: 26px; }

/* Main octagonal case face */
.gs-face {
    width: 158px;
    height: 166px;
    background: linear-gradient(160deg, #202020 0%, #131313 45%, #0e0e0e 100%);
    clip-path: polygon(
        19px 0%, calc(100% - 19px) 0%,
        100% 19px, 100% calc(100% - 19px),
        calc(100% - 19px) 100%, 19px 100%,
        0% calc(100% - 19px), 0% 19px
    );
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Corner cylinder bumps */
.gs-bump {
    position: absolute;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 32%, #383838, #1c1c1c 55%, #0c0c0c);
    box-shadow: 0 2px 4px rgba(0,0,0,0.95), inset 0 1px 1px rgba(255,255,255,0.06);
    z-index: 3;
}
#gs-btl { top: 14px;    left: 14px; }
#gs-btr { top: 14px;    right: 14px; }
#gs-bbl { bottom: 14px; left: 14px; }
#gs-bbr { bottom: 14px; right: 14px; }

/* Bezel engravings */
.gs-bezel-top {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Arial Black', 'Arial', sans-serif;
    font-size: 6.5px;
    font-weight: 900;
    letter-spacing: 2px;
    color: #7a7a8a;
    white-space: nowrap;
    z-index: 2;
    text-shadow: 0 1px 0 rgba(0,0,0,0.8);
}
.gs-bezel-bot {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Arial Black', 'Arial', sans-serif;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 3px;
    color: #9a9aaa;
    white-space: nowrap;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.9);
}

/* Side labels (vertical text in bezel margins) */
.gs-lbl {
    position: absolute;
    font-size: 4.5px;
    font-weight: bold;
    color: #5a5a6a;
    white-space: nowrap;
    z-index: 2;
    letter-spacing: 0.4px;
    font-family: 'Arial', sans-serif;
    line-height: 1.3;
}
.gs-lbl-adjust {
    left: 3px; top: 31px;
    transform: rotate(-90deg);
    transform-origin: left center;
}
.gs-lbl-mode {
    left: 3px; top: 76px;
    transform: rotate(-90deg);
    transform-origin: left center;
}
.gs-lbl-start {
    right: 2px; top: 36px;
    transform: rotate(90deg);
    transform-origin: right center;
    text-align: center;
}
.gs-lbl-light {
    right: 3px; top: 88px;
    transform: rotate(90deg);
    transform-origin: right center;
}

/* Inner module */
.gs-module {
    width: 118px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    z-index: 1;
}

/* CASIO + ILLUMINATOR header */
.gs-mod-hdr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2px;
    height: 13px;
}
.gs-casio {
    font-family: 'Arial Black', 'Arial', sans-serif;
    font-size: 9px;
    font-weight: 900;
    color: #e8e8e8;
    letter-spacing: 0.5px;
}
.gs-illum {
    font-family: 'Arial', sans-serif;
    font-size: 4.5px;
    font-weight: bold;
    color: #d4a017;
    letter-spacing: 0.3px;
}

/* Red-bordered panel */
.gs-panel {
    border: 2px solid #c8101e;
    border-radius: 2px;
    background: #0c0c0c;
    display: flex;
    flex-direction: column;
}

/* Panel top row: SHOCK RESIST + SPLIT/RESET */
.gs-panel-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 4px 2px;
}
.gs-shock-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #c8a020;
    padding: 1px 3px;
    border-radius: 1px;
    gap: 0;
}
.gs-shock-badge span {
    font-family: 'Arial', sans-serif;
    font-size: 3.8px;
    font-weight: bold;
    color: #c8a020;
    line-height: 1.4;
    white-space: nowrap;
}
.gs-panel-top-r {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}
.gs-panel-top-r span {
    font-family: 'Arial', sans-serif;
    font-size: 4px;
    color: #707080;
    white-space: nowrap;
}

/* LCD display */
.gs-lcd {
    background: #bfc2a6;
    background-image: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0) 50%);
    padding: 3px 5px 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
/* Row 1: alarm+day / date-box */
.gs-lcd-r1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.gs-lcd-tl {
    display: flex;
    align-items: center;
    gap: 3px;
}
.gs-signal {
    font-size: 7px;
    color: #1a1a1a;
    letter-spacing: -2px;
    line-height: 1;
    font-family: monospace;
    opacity: 0.7;
}
.gs-day {
    font-family: 'Courier New', monospace;
    font-size: 15px;
    font-weight: bold;
    color: #111;
    letter-spacing: 1px;
    line-height: 1;
}
.gs-lcd-date {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    font-weight: bold;
    color: #111;
    border: 1px solid #1a1a1a;
    padding: 1px 4px;
    line-height: 1;
}
/* Row 2: PM + time + seconds */
.gs-lcd-mid {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    line-height: 1;
}
.gs-pm {
    font-family: 'Courier New', monospace;
    font-size: 7px;
    font-weight: bold;
    color: #111;
    line-height: 1;
    align-self: flex-start;
    margin-top: 2px;
}
.gs-time {
    font-family: 'Courier New', monospace;
    font-size: 26px;
    font-weight: bold;
    color: #0d0d0d;
    letter-spacing: -1px;
    line-height: 1;
}


/* Panel bottom row: WATER RESIST / 12-24HR */
.gs-panel-bot {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 2px 4px 3px;
}
.gs-panel-bot-l,
.gs-panel-bot-r {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.gs-panel-bot-l span,
.gs-panel-bot-r span {
    font-family: 'Arial', sans-serif;
    font-size: 4px;
    font-weight: bold;
    white-space: nowrap;
}
.gs-blue-t { color: #4090d0; }
.gs-red-t  { color: #c8101e; }
.gs-panel-bot-r span { color: #707080; }

/* ALARM CHRONOGRAPH */
.gs-alarm-chrono {
    font-family: 'Arial Black', 'Arial', sans-serif;
    font-size: 6px;
    font-weight: 900;
    color: #c8a020;
    letter-spacing: 1.5px;
    text-align: center;
    padding: 3px 0 1px;
    white-space: nowrap;
}