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

html {
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    font-family: 'Unbounded', sans-serif;
    background: linear-gradient(180deg, #121221 0%, #000000 100%) fixed;
    min-height: 100vh;
    min-height: 100dvh;
    color: #ffffff;
    overflow-x: hidden;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background-color: #0E1350;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
}

.logo-link {
    display: flex;
    align-items: center;
}

.site-logo {
    height: 36px;
    width: auto;
}

.nav-menu {
    display: flex;
    align-items: center;
}

.dropdown {
    position: relative;
}

.dropdown-button {
    background: transparent;
    border: none;
    color: #29FBCD;
    font-family: 'Unbounded', sans-serif;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    padding: 8px 16px;
    transition: opacity 0.2s ease;
}

.dropdown-button:hover {
    opacity: 0.8;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: #0E1350;
    min-width: 180px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    padding-top: 4px;
}

.dropdown-content::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 14px;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 12px 16px;
    color: #29FBCD;
    text-decoration: none;
    font-family: 'Unbounded', sans-serif;
    font-size: 13px;
    font-weight: 400;
    transition: background 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(41, 251, 205, 0.1);
}

.dropdown-item.active {
    background: rgba(41, 251, 205, 0.15);
}

.nav-link {
    color: #29FBCD;
    font-family: 'Unbounded', sans-serif;
    font-size: 14px;
    font-weight: 400;
    text-decoration: none;
    padding: 8px 16px;
    transition: opacity 0.2s ease;
}

.nav-link:hover {
    opacity: 0.8;
}

/* Title row with hamburger */
.title-row {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Hamburger button - hidden on desktop, shown on mobile */
.hamburger-button {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #B74CFF;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Side menu overlay */
.side-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1500;
}

.side-menu-overlay.open {
    display: block;
}

/* Side menu */
.side-menu {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background: #0E1350;
    z-index: 2000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 24px;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
}

.side-menu.open {
    right: 0;
}

.side-menu-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 32px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    line-height: 1;
}

.side-menu-close:hover {
    opacity: 1;
}

.side-menu-logo {
    display: flex;
    align-items: center;
    margin-bottom: 32px;
    margin-top: 8px;
}

.side-menu-logo .site-logo {
    height: 32px;
}

.side-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.side-menu-link {
    color: #29FBCD;
    font-family: 'Unbounded', sans-serif;
    font-size: 15px;
    font-weight: 400;
    text-decoration: none;
    padding: 14px 16px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.side-menu-link:hover,
.side-menu-link.active {
    background: rgba(41, 251, 205, 0.1);
}

@media (max-width: 768px) {
    .site-header {
        display: none;
    }

    .hamburger-button {
        display: flex;
    }
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
    padding-top: 72px;
    touch-action: none;
}

header {
    text-align: center;
    padding: 12px 0;
}

.title {
    font-size: 2rem;
    font-weight: 900;
    color: #B74CFF;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(183, 76, 255, 0.3);
}

.daily-info {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.daily-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #B74CFF;
}

.date-display {
    font-size: 0.85rem;
    font-weight: 300;
    color: rgba(255,255,255,0.6);
}

.size-label {
    font-size: 0.85rem;
    font-weight: 300;
    color: rgba(255,255,255,0.4);
}

.next-puzzle-countdown {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    margin-top: 16px;
    font-weight: 300;
}

.next-puzzle-countdown span {
    color: #B74CFF;
    font-weight: 500;
}

.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    overflow: visible;
    position: relative;
}

@media (max-width: 768px) {
    .container {
        padding-top: 8px;
    }

    header {
        padding: 4px 0;
    }
}

.board-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameBoard {
    border-radius: 4px;
    touch-action: none;
}

#gameBoard {
    cursor: pointer;
}

.status-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 10px 0;
    flex-wrap: wrap;
}

.timer-display {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    font-weight: 400;
}

.timer-icon {
    font-size: 16px;
}

.tool-switcher {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 3px;
}

.tool-button {
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    color: rgba(255,255,255,0.6);
    font-family: 'Unbounded', sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tool-button.active {
    background: rgba(183,76,255,0.25);
    color: #B74CFF;
}

.tool-button:hover:not(.active) {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.8);
}

.tool-fill-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: currentColor;
    border-radius: 2px;
}

.tool-mark-icon {
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.undo-redo-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-button {
    background: transparent;
    border: 1.5px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    padding: 5px 10px;
    color: rgba(255,255,255,0.7);
    font-family: 'Unbounded', sans-serif;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1;
}

.action-button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255,255,255,0.5);
}

.action-button:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

/* puzzle-nav-btn removed — daily mode */

.help-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: transparent;
    border: 3px solid #FFFFFF;
    color: #FFFFFF;
    font-family: 'Unbounded', sans-serif;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    z-index: 5;
    transition: transform 0.2s ease, background 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.help-button:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .help-button {
        bottom: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

.help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.help-overlay.show {
    display: flex;
}

.help-content {
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 30px;
    margin: 20px;
    background: linear-gradient(135deg, #1E1E1E 0%, #2D2D2D 100%);
    border-radius: 16px;
    border: 2px solid #4E4EFE;
    box-shadow: 0 0 40px rgba(78, 78, 254, 0.3);
    position: relative;
}

.help-content h2 {
    font-size: 1.5rem;
    color: #B74CFF;
    margin-bottom: 12px;
    margin-top: 20px;
}

.help-content h2:first-of-type {
    margin-top: 0;
}

.help-content p {
    color: #FFFFFF;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.help-content ul {
    color: #FFFFFF;
    font-size: 14px;
    line-height: 1.8;
    padding-left: 20px;
    margin-bottom: 16px;
}

.help-content li {
    margin-bottom: 8px;
}

.help-content strong {
    color: #B74CFF;
}

.help-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #FFFFFF;
    font-size: 28px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.help-close:hover {
    opacity: 1;
}

.win-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.win-overlay.show {
    display: flex;
}

.win-content {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #1E1E1E 0%, #2D2D2D 100%);
    border-radius: 16px;
    border: 2px solid #4E4EFE;
    box-shadow: 0 0 40px rgba(78, 78, 254, 0.3);
    position: relative;
}

.win-content h2 {
    font-size: 2rem;
    font-weight: 900;
    color: #39FF1B;
    margin-bottom: 16px;
}

.win-content p {
    font-size: 1rem;
    font-weight: 300;
    color: #ffffff;
    margin-bottom: 8px;
}

#winCanvas {
    display: block;
    margin: 20px auto;
    border-radius: 8px;
}

.win-time {
    font-size: 0.9rem;
    color: #B74CFF;
    font-weight: 500;
}

.play-again-button {
    background: transparent;
    border: 2px solid #4E4EFE;
    border-radius: 8px;
    padding: 12px 32px;
    color: #B74CFF;
    font-family: 'Unbounded', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
    margin-top: 24px;
}

.play-again-button:hover {
    transform: translateY(-2px);
    background: rgba(78, 78, 254, 0.1);
}

.play-again-button:active {
    transform: translateY(0);
}

.win-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #FFFFFF;
    font-size: 28px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    line-height: 1;
}

.win-close:hover {
    opacity: 1;
}

/* Calendar button */
.calendar-button {
    background: transparent;
    border: 1.5px solid rgba(183, 76, 255, 0.4);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.calendar-button:hover {
    border-color: #B74CFF;
    background: rgba(183, 76, 255, 0.1);
}

/* Calendar overlay */
.calendar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.calendar-overlay.show {
    display: flex;
}

.calendar-content {
    max-width: 420px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 30px;
    background: linear-gradient(135deg, #1E1E1E 0%, #2D2D2D 100%);
    border-radius: 16px;
    border: 2px solid #4E4EFE;
    box-shadow: 0 0 40px rgba(78, 78, 254, 0.3);
    position: relative;
}

.calendar-content h2 {
    font-size: 1.3rem;
    color: #B74CFF;
    margin-bottom: 16px;
    text-align: center;
}

.calendar-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #FFFFFF;
    font-size: 28px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    line-height: 1;
}

.calendar-close:hover {
    opacity: 1;
}

.calendar-month-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.calendar-nav-btn {
    background: transparent;
    border: 1.5px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    padding: 4px 12px;
    color: rgba(255,255,255,0.7);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: 'Unbounded', sans-serif;
}

.calendar-nav-btn:hover:not(:disabled) {
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.1);
}

.calendar-nav-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.calendar-month-label {
    font-family: 'Unbounded', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255,255,255,0.8);
    min-width: 130px;
    text-align: center;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 16px;
}

.calendar-day-header {
    text-align: center;
    font-family: 'Unbounded', sans-serif;
    font-size: 10px;
    font-weight: 500;
    color: rgba(255,255,255,0.4);
    padding: 4px 0;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 6px;
    font-family: 'Unbounded', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: rgba(255,255,255,0.3);
    cursor: default;
    position: relative;
}

.calendar-day.available {
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.05);
    cursor: pointer;
    transition: all 0.15s ease;
}

.calendar-day.available:hover {
    background: rgba(183, 76, 255, 0.2);
    color: #ffffff;
}

.calendar-day.today {
    border: 2px solid #B74CFF;
    color: #B74CFF;
    font-weight: 700;
}

.calendar-day.completed::after {
    content: '✓';
    position: absolute;
    bottom: 1px;
    right: 3px;
    font-size: 8px;
    color: #39FF1B;
    font-weight: 700;
}

.calendar-day.active-day {
    background: rgba(183, 76, 255, 0.3);
    color: #ffffff;
    font-weight: 700;
}

.calendar-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Unbounded', sans-serif;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.legend-dot.completed {
    background: #39FF1B;
}

.legend-dot.today {
    border: 2px solid #B74CFF;
}

.legend-dot.available {
    background: rgba(255,255,255,0.15);
}

/* Viewing past puzzle indicator */
.viewing-past {
    display: none;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.viewing-past.show {
    display: flex;
    justify-content: center;
}

.viewing-past-label {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    font-weight: 300;
}

.back-to-today-btn {
    background: transparent;
    border: 1.5px solid #B74CFF;
    border-radius: 6px;
    padding: 3px 10px;
    color: #B74CFF;
    font-family: 'Unbounded', sans-serif;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.back-to-today-btn:hover {
    background: rgba(183, 76, 255, 0.15);
}

/* ── SEO Content Section ── */

.seo-content {
    background: transparent;
    padding: 60px 20px 80px;
    position: relative;
}

.seo-inner {
    max-width: 720px;
    margin: 0 auto;
}

.seo-content h2 {
    font-family: 'Unbounded', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #B74CFF;
    margin-bottom: 16px;
    margin-top: 48px;
}

.seo-content h2:first-child {
    margin-top: 0;
}

.seo-content p {
    font-family: 'Unbounded', sans-serif;
    font-size: 0.85rem;
    font-weight: 300;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 16px;
}

.faq-item {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 24px 0;
}

.faq-item:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.faq-item h3 {
    font-family: 'Unbounded', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: #4E4EFE;
    margin-bottom: 10px;
}

.faq-item p {
    font-family: 'Unbounded', sans-serif;
    font-size: 0.82rem;
    font-weight: 300;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0;
}

/* Responsive adjustments */
@media (max-width: 400px) {
    .title {
        font-size: 1.5rem;
    }

    .seo-content {
        padding: 40px 16px 60px;
    }

    .seo-content h2 {
        font-size: 1.15rem;
        margin-top: 36px;
    }

    .seo-content p {
        font-size: 0.8rem;
    }

    .faq-item h3 {
        font-size: 0.9rem;
    }

    .faq-item p {
        font-size: 0.78rem;
    }
}

/* Landscape mode */
@media (orientation: landscape) and (max-height: 500px) {
    .container {
        padding: 8px;
    }

    header {
        padding: 4px 0;
    }

    .title {
        font-size: 1.2rem;
    }

    .daily-info {
        flex-direction: row;
        gap: 12px;
        margin-top: 4px;
    }
}

/* Related Articles section */
.blog-section {
    max-width: 720px;
    margin: 48px auto 0;
    padding: 0 20px;
}
.blog-section h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #29FBCD;
    text-align: center;
    margin-bottom: 20px;
    font-family: 'Unbounded', sans-serif;
}
.blog-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.blog-link-card {
    display: block;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
}
.blog-link-card:hover {
    border-color: rgba(41, 251, 205, 0.3);
    background: rgba(41, 251, 205, 0.05);
}
.blog-link-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: #29FBCD;
    margin-bottom: 4px;
    font-family: 'Unbounded', sans-serif;
}
.blog-link-excerpt {
    font-size: 0.8rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.5;
    font-family: 'Unbounded', sans-serif;
}
