/* ==== Revamped Sundial Styles ==== */
.sundial-wheel {
    position: relative;
    width: 240px;
    height: 240px;
    margin: 0 auto 12px auto;
}
.letter-cell {
    position: absolute;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid #444;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    font-weight: 600;
    background: radial-gradient(circle at 30% 30%, #3a3d44, #23252b);
    color: #fff;
    box-shadow: 0 4px 10px -2px rgba(0,0,0,0.5);
    user-select: none;
    transition: transform .18s, background .3s, color .3s, box-shadow .3s;
    cursor: pointer;
}
.letter-cell:hover { transform: translateY(-4px) scale(1.05); }
.letter-cell:active { transform: scale(.92); }
.center-letter {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at 30% 30%, #ffda66, #ffb300);
    color: #222;
    border-color: #ffb300;
    font-size: 2rem;
    font-weight: 700;
}
body.dark-mode .letter-cell { background: radial-gradient(circle at 30% 30%, #444, #1e1f23); }
body.dark-mode .center-letter { background: radial-gradient(circle at 30% 30%, #ffd54f, #ffb300); color: #222; }

/* Hidden words aside improvements */
#hidden-words-aside {
    max-height: 520px;
    overflow-y: auto;
    scrollbar-width: thin;
}
#hidden-words-aside h3 { margin: 4px 0 12px 0; font-size: 1.05rem; letter-spacing: .5px; }
.hidden-words-grid { grid-template-columns: repeat(3, 1fr); }
.hidden-word-box { font-size: .95rem; letter-spacing: .5px; }

/* Remove legacy explicit index positioning when new wheel is used */
.sundial-9th > div[data-index]{ position: static; }
.game-layout {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
    width: 100%;
    margin-bottom: 24px;
}

#sundial-center-wrap {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 340px;
}

#sundial-box {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 300px;
    height: 300px;
    margin: 0;
    background: #f5f5f5;
    border-radius: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    border: 2px solid #ccc;
    position: relative;
    z-index: 2;
}
body.dark-mode #sundial-box {
    background: #23252b;
    border-color: #444;
}

#hidden-words-aside {
    min-width: 220px;
    background: #23252b;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    padding: 16px 12px 24px 12px;
    color: #ffe066;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    right: 0;
    top: 80px;
}
body.dark-mode #hidden-words-aside {
    background: #181818;
    color: #ffe066;
}
/* Layout for game and hidden words */
.game-layout {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 32px;
    width: 100%;
    margin-bottom: 24px;
}

#sundial-box {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 300px;
    height: 300px;
    margin: 0;
    background: #f5f5f5;
    border-radius: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    border: 2px solid #ccc;
    position: relative;
    z-index: 2;
}
body.dark-mode #sundial-box {
    background: #23252b;
    border-color: #444;
}

#hidden-words-aside {
    min-width: 220px;
    background: #23252b;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    padding: 16px 12px 24px 12px;
    color: #ffe066;
    display: flex;
    flex-direction: column;
    align-items: center;
}
body.dark-mode #hidden-words-aside {
    background: #181818;
    color: #ffe066;
}
/* Sundial box container to prevent overlap */
#sundial-box {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 300px;
    height: 300px;
    margin: 24px auto 16px auto;
    background: #f5f5f5;
    border-radius: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    border: 2px solid #ccc;
    position: relative;
    z-index: 2;
}
body.dark-mode #sundial-box {
    background: #23252b;
    border-color: #444;
}
/* Hidden Words Grid for hidden.html */
.hidden-words-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 24px 0;
    padding: 0;
    list-style: none;
}
.hidden-word-box {
    background: #23252b;
    color: #ffe066;
    border: 2px solid #444;
    border-radius: 8px;
    padding: 12px 0;
    text-align: center;
    font-size: 1.1em;
    font-weight: bold;
    min-height: 32px;
    transition: background 0.3s, color 0.3s;
}
.hidden-word-box.revealed {
    background: #ffe066;
    color: #23252b;
    border-color: #bfa76f;
}
input[type="text"], button {
    background: #23252b;
    color: #ffe066;
    border: 2px solid #444;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 1em;
    margin: 8px 0;
    transition: background 0.3s, color 0.3s;
}
input[type="text"].light-mode, button.light-mode {
    background: #fff;
    color: #23252b;
    border-color: #bfa76f;
}

body {
    min-height: 100vh;
    background: #181a20 !important;
    color: #f8f8f8 !important;
    font-family: 'Segoe UI', Arial, sans-serif;
    transition: background 0.3s, color 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.game-grid {
      width: 260px;
      height: 260px;
      margin: 32px auto 16px auto;
      position: relative;
      background: transparent;
      z-index: 1;
    }
    
.app {
    max-width: 480px;
    margin: 32px auto;
    background: #23252b;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
    padding: 24px 16px 32px 16px;
    color: #f8f8f8;
}

.header {
    text-align: center;
    margin-bottom: 16px;
    color: #ffe066;
}

.sundial-container {
    position: relative;
    width: 240px;
    height: 240px;
    margin: 32px auto;
    background: none;
}

.sundial-letter, .sundial-center {
    position: absolute;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #222;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border: 2px solid #444;
    z-index: 1;
}
.sundial-center {
    background: #ffb300;
    color: #222;
    border: 2px solid #ff9800;
    z-index: 2;
}
body.dark-mode {
    background: #181818;
    color: #eee;
}
body.dark-mode .sundial-letter {
    background: #333;
    color: #fff;
    border-color: #555;
}
body.dark-mode .sundial-center {
    background: #ffd54f;
    color: #222;
    border-color: #ffb300;
}

.found-words {
    margin-top: 24px;
    font-size: 1em;
    color: #ffe066;
    text-align: center;
}

#darkModeToggle {
    position: fixed;
    top: 16px;
    right: 16px;
    background: #23252b;
    color: #ffe066;
    border: none;
    border-radius: 24px;
    padding: 8px 18px;
    font-size: 1em;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

body.light-mode {
    background: #f5f5f5 !important;
    color: #23252b !important;
}
.app.light-mode {
    background: #fff;
    color: #23252b;
}
.header.light-mode {
    color: #6b4f1d;
        position: relative;
        width: 260px;
        height: 260px;
        margin: 0 auto;
        display: block;
        background: transparent;
    }
.sundial-letter.light-mode {
    background: #f5f5dc;
    color: #6b4f1d;
    border-color: #bfa76f;
}
.sundial-center.light-mode {
    background: #ffe066;
    color: #6b4f1d;
    border-color: #bfa76f;
}
.found-words.light-mode {
    color: #23252b;
}
input[type="text"], button {
    background: #23252b;
    color: #ffe066;
    border: 2px solid #ffe066;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 1em;
    margin: 8px 0;
    transition: background 0.3s, color 0.3s;
}
input[type="text"].light-mode, button.light-mode {
    background: #fff;
    color: #23252b;
    border-color: #bfa76f;
}

.app {
    max-width: 480px;
    margin: 0 auto;
    background: #23252b;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
    padding: 24px 16px 32px 16px;
}

.header {
    text-align: center;
    margin-bottom: 16px;
}

.sundial-container {
    position: relative;
    width: 240px;
    height: 240px;
    margin: 32px auto;
    background: none;
}

.sundial-letter, .sundial-center {
    position: absolute;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #222;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border: 2px solid #444;
    z-index: 1;
}
.sundial-center {
    background: #ffb300;
    color: #222;
    border: 2px solid #ff9800;
    z-index: 2;
}
body.dark-mode {
    background: #181818;
    color: #eee;
}
body.dark-mode .sundial-letter {
    background: #333;
    color: #fff;
    border-color: #555;
}
body.dark-mode .sundial-center {
    background: #ffd54f;
    color: #222;
    border-color: #ffb300;
}
.found-words {
    margin-top: 24px;
    font-size: 1em;
    color: #333;
    text-align: center;
}
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f8fafc;
    color: #222;
    margin: 0;
}
.app {
    max-width: 600px;
    margin: 0 auto;
    padding: 2em;
}
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2em;
}
nav a {
    margin-left: 1em;
    text-decoration: none;
    color: #0ea5e9;
    font-weight: 500;
}
nav a:hover {
    text-decoration: underline;
}
.game-info {
    margin-bottom: 1em;
    font-size: 1.2em;
}
.game-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    margin-bottom: 1em;
}
.word-cell {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.5em 1em;
    font-size: 1em;
    min-width: 80px;
    text-align: center;
    transition: background 0.2s;
}
.word-cell.found {
    background: #bbf7d0;
    border-color: #22c55e;
}
input[type="text"] {
    padding: 0.5em;
    font-size: 1em;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    margin-right: 0.5em;
}
button {
    padding: 0.5em 1em;
    font-size: 1em;
    border-radius: 6px;
    border: none;
    background: #0ea5e9;
    color: #fff;
    cursor: pointer;
    font-weight: 500;
}
button:disabled {
    background: #e5e7eb;
    color: #888;
    cursor: not-allowed;
}
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal.hidden {
    display: none;
}
.modal-content {
    background: #fff;
    padding: 2em;
    border-radius: 8px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.1);
    text-align: center;
}
.sundial {
    position: relative;
    width: 240px;
    height: 240px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}
.sundial-9th > div {
    position: absolute;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #222;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border: 2px solid #444;
    z-index: 1;
}
.sundial-9th > div[data-central="true"] {
    background: #ffb300;
    color: #222;
    border: 2px solid #ff9800;
    z-index: 2;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}
.sundial-9th > div[data-index="0"] { left: 50%; top: 0%; transform: translate(-50%, 0); }
.sundial-9th > div[data-index="1"] { left: 80%; top: 20%; transform: translate(-50%, -50%); }
.sundial-9th > div[data-index="2"] { left: 100%; top: 50%; transform: translate(-100%, -50%); }
.sundial-9th > div[data-index="3"] { left: 80%; top: 80%; transform: translate(-50%, -100%); }
.sundial-9th > div[data-index="5"] { left: 20%; top: 80%; transform: translate(-50%, -100%); }
.sundial-9th > div[data-index="6"] { left: 0%; top: 50%; transform: translate(0, -50%); }
.sundial-9th > div[data-index="7"] { left: 20%; top: 20%; transform: translate(-50%, -50%); }
.sundial-9th > div[data-index="8"] { left: 50%; top: 100%; transform: translate(-50%, 0); }
.inner-cell {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
@media (max-width: 600px) {
    .app { padding: 1em; }
    .word-cell { min-width: 60px; font-size: 0.9em; }
}
/* ===== New Overrides & Enhancements ===== */
/* Aside refinement */
#hidden-words-aside { min-width:260px; background:#23252b; border-radius:18px; box-shadow:0 4px 18px rgba(0,0,0,.35); padding:18px 16px 26px 16px; color:#ffe066; display:flex; flex-direction:column; align-items:stretch; gap:12px; position:static; top:auto; right:auto; max-height:520px; }
#hidden-words-aside h3 { margin:0 0 4px 0; font-size:1.05rem; letter-spacing:.5px; font-weight:600; text-align:center; }
.hidden-words-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin:4px 0 8px 0; padding:0; list-style:none; }
.hidden-word-box { background:#2b2e34; color:#ffe066; border:1px solid #505458; border-radius:10px; padding:10px 0; text-align:center; font-size:.9rem; font-weight:600; min-height:34px; letter-spacing:.5px; transition:background .25s,color .25s,border-color .25s; }
.hidden-word-box.revealed { background:#ffe066; color:#23252b; border-color:#bfa76f; }
body.dark-mode .hidden-word-box { background:#1f2023; border-color:#3a3d42; }
body.dark-mode .hidden-word-box.revealed { background:#ffe066; color:#23252b; }

/* Wheel tweaks */
.sundial-wheel { width:260px; height:260px; margin:4px auto 8px auto; }
.letter-cell { width:60px; height:60px; border:2px solid #3e444a; font-size:1.85rem; background:radial-gradient(circle at 30% 30%, #3d4046, #1f2226); color:#f5f7fa; }
.center-letter { background:radial-gradient(circle at 25% 25%, #ffe58f, #ffb300); color:#222; border-color:#ffb300; }

/* Controls */
.controls { display:flex; gap:8px; align-items:center; justify-content:center; flex-wrap:wrap; margin:8px auto 12px auto; }
.controls input { flex:1 1 160px; }
.controls button.secondary { background:#394048; border:1px solid #4a525a; }
.controls button.secondary:hover { background:#465059; }

.progress-count { margin-left:12px; font-size:.9rem; opacity:.85; }
.instructions { font-size:.75rem; text-align:center; max-width:520px; margin:0 auto 12px; opacity:.65; }

.aside-actions { display:flex; gap:8px; justify-content:space-between; }
.aside-actions button { flex:1; background:#394048; color:#ffe066; border:1px solid #525960; padding:6px 8px; font-size:.8rem; border-radius:8px; cursor:pointer; }
.aside-actions button:hover { background:#485159; }
body.dark-mode .aside-actions button { background:#2d3136; border-color:#444b52; }
body.dark-mode .aside-actions button:hover { background:#3a4046; }

/* Flash animation for share */
.flash { animation: flashBg .9s ease-in-out; }
@keyframes flashBg { 0%{background:#ffe066;color:#222;} 100%{} }
