:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --accent-color: #007bff;
    --accent-hover: #0056b3;
    --shadow: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #e9ecef;
    --text-secondary: #adb5bd;
    --border-color: #495057;
    --accent-color: #4dabf7;
    --accent-hover: #339af0;
    --shadow: rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    padding-bottom: 60px; /* Space for ticker */
    margin: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior-y: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* App-like sections */
section {
    padding: 15px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color);
}

section:last-of-type {
    border-bottom: none;
}

/* RTL Support */
[dir="rtl"] {
    direction: rtl;
}

[dir="rtl"] header {
    flex-direction: row-reverse;
}

[dir="rtl"] .header-controls {
    flex-direction: row-reverse;
}

[dir="rtl"] .calendar-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .holiday-navigation {
    flex-direction: row-reverse;
}

[dir="rtl"] .shabbat-info {
    flex-direction: row-reverse;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
    flex-wrap: wrap;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px var(--shadow);
}

header h1 {
    order: 2;
    flex: 1;
    text-align: center;
}

.header-controls {
    order: 3;
}

.menu-toggle {
    order: 1;
}

.menu-toggle {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    -webkit-tap-highlight-color: rgba(0,123,255,0.2);
    color: var(--text-primary);
    flex-shrink: 0;
}

.menu-toggle:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.menu-toggle:active {
    background: var(--accent-color);
    color: white;
    transform: scale(0.95);
}

/* Side Menu */
.side-menu {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: var(--bg-primary);
    box-shadow: 2px 0 10px var(--shadow);
    z-index: 1000;
    transition: left 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.side-menu.active {
    left: 0;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.menu-header h2 {
    font-size: 1.3rem;
    margin: 0;
    color: var(--text-primary);
    font-weight: 600;
}

.menu-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    padding: 0;
    -webkit-tap-highlight-color: rgba(0,123,255,0.2);
}

.menu-close:hover {
    background: var(--bg-secondary);
}

.menu-close:active {
    background: var(--accent-color);
    color: white;
    transform: scale(0.95);
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-list li {
    border-bottom: 1px solid var(--border-color);
}

.menu-list li:last-child {
    border-bottom: none;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
    -webkit-tap-highlight-color: rgba(0,123,255,0.2);
    min-height: 44px;
    font-size: 1rem;
}

.menu-link:hover {
    background: var(--bg-secondary);
}

.menu-link:active {
    background: var(--accent-color);
    color: white;
}

.menu-button {
    width: 100%;
    padding: 15px 20px;
    background: var(--accent-color);
    color: white;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    -webkit-tap-highlight-color: rgba(0,123,255,0.2);
    min-height: 44px;
    border-radius: 0;
    font-weight: 500;
}

.menu-button:hover {
    background: var(--accent-hover);
}

.menu-button:active {
    background: var(--accent-hover);
    transform: scale(0.98);
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

header h1 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    min-width: 200px;
    margin: 0;
}

.header-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.theme-toggle, .lang-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-toggle {
    border-radius: 20px;
    padding: 0 12px;
    width: auto;
    min-width: 60px;
    font-weight: 500;
}

.theme-toggle:hover, .lang-toggle:hover {
    background: var(--accent-color);
    color: white;
    transform: scale(1.05);
}

/* Clock Section */
.clock-section {
    margin-bottom: 30px;
}

.clock-section {
    background: var(--bg-primary);
    padding: 20px 15px;
}

.world-clock {
    text-align: center;
    padding: 25px 15px;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    border: none;
    border-radius: 0;
    box-shadow: none;
    color: white;
}

.world-clock .time-display,
.world-clock .date-display,
.world-clock .location-display {
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.time-display {
    font-size: clamp(2rem, 8vw, 3.5rem);
    font-weight: 300;
    margin-bottom: 8px;
    color: var(--accent-color);
    font-variant-numeric: tabular-nums;
    word-break: break-word;
}

.date-display {
    font-size: clamp(0.9rem, 3vw, 1.2rem);
    color: var(--text-secondary);
    margin-bottom: 8px;
    word-break: break-word;
}

.location-display {
    font-size: clamp(0.85rem, 2.5vw, 1rem);
    color: var(--text-secondary);
    margin-bottom: 15px;
    word-break: break-word;
}

.country-select {
    padding: 12px 15px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 25px;
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    cursor: pointer;
    width: 100%;
    max-width: 100%;
    margin-top: 15px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.country-select option {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Preferences Section */
.preferences-section {
    background: var(--bg-primary);
    padding: 20px 15px;
}

.preferences-section h2 {
    font-size: clamp(1.1rem, 4vw, 1.3rem);
    margin-bottom: 12px;
    font-weight: 400;
}

.preferences-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.preference-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    transition: all 0.3s;
    min-height: 44px; /* iOS touch target */
    -webkit-tap-highlight-color: rgba(0,123,255,0.2);
}

.preference-item:active {
    transform: scale(0.98);
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.preference-item input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Calendar Section */
.calendar-section {
    background: var(--bg-primary);
    padding: 20px 15px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    gap: 10px;
}

.calendar-header h2 {
    font-size: clamp(1rem, 4vw, 1.4rem);
    font-weight: 400;
    flex: 1;
    text-align: center;
}

.nav-btn {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    padding: 0;
    cursor: pointer;
    font-size: 1.3rem;
    color: var(--text-primary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: rgba(0,123,255,0.2);
    min-width: 44px; /* iOS touch target */
}

.nav-btn:active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: scale(0.95);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    background: var(--bg-secondary);
    padding: 10px;
    border-radius: 16px;
    overflow-x: auto;
}

.calendar-day-header {
    text-align: center;
    padding: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.calendar-day {
    aspect-ratio: 1;
    padding: 6px 4px;
    background: var(--bg-primary);
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 44px;
    -webkit-tap-highlight-color: rgba(0,123,255,0.2);
}

.calendar-day:active {
    transform: scale(0.95);
    background: var(--accent-color);
    color: white;
}

.calendar-day:hover {
    background: var(--accent-color);
    color: white;
    transform: scale(1.05);
}

.calendar-day.today {
    background: var(--accent-color);
    color: white;
    font-weight: 600;
}

.calendar-day.other-month {
    opacity: 0.4;
}

.day-number {
    font-size: clamp(0.7rem, 2vw, 0.9rem);
    margin-bottom: 2px;
    font-weight: 500;
}

.day-events {
    font-size: clamp(0.6rem, 1.8vw, 0.7rem);
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.event-icon {
    font-size: clamp(0.7rem, 2vw, 0.8rem);
}

/* Holidays Section */
.holidays-section {
    background: var(--bg-primary);
    padding: 20px 15px;
}

.holidays-section h2 {
    font-size: clamp(1.1rem, 4vw, 1.3rem);
    margin-bottom: 15px;
    font-weight: 400;
}

.holiday-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.holiday-display {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--bg-secondary);
    border: none;
    border-radius: 16px;
    min-width: 0;
    box-shadow: 0 2px 8px var(--shadow);
}

.holiday-icon {
    font-size: clamp(2rem, 6vw, 3rem);
    flex-shrink: 0;
}

.holiday-info {
    flex: 1;
    min-width: 0;
}

.holiday-name {
    font-size: clamp(1rem, 4vw, 1.4rem);
    font-weight: 500;
    margin-bottom: 6px;
    word-break: break-word;
}

.holiday-date {
    font-size: clamp(0.85rem, 3vw, 1rem);
    color: var(--text-secondary);
    margin-bottom: 4px;
    word-break: break-word;
}

.holiday-type {
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    color: var(--accent-color);
}

/* Shabbat Section */
.shabbat-section {
    background: var(--bg-primary);
    padding: 20px 15px;
}

.shabbat-section h2 {
    font-size: clamp(1.1rem, 4vw, 1.3rem);
    margin-bottom: 12px;
    font-weight: 400;
}

.shabbat-info {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.shabbat-time {
    padding: 15px;
    background: var(--bg-secondary);
    border: none;
    border-radius: 12px;
    flex: 1;
    min-width: 150px;
    box-shadow: 0 2px 6px var(--shadow);
}

.shabbat-time .label {
    display: block;
    color: var(--text-secondary);
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    margin-bottom: 5px;
}

.shabbat-time span:last-child {
    font-size: clamp(1rem, 3vw, 1.2rem);
    font-weight: 500;
    color: var(--accent-color);
    word-break: break-word;
}

/* Parasha Section */
.parasha-section {
    margin-top: 20px;
    padding: 15px;
    background: var(--bg-primary);
    border: 2px solid var(--accent-color);
    border-radius: 12px;
    text-align: center;
}

.parasha-section h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-weight: 400;
}

.parasha-name {
    font-size: 1.2rem;
}

.parasha-hebrew {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 5px;
    direction: rtl;
}

.parasha-english {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Date Events Popup */
.date-events-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    padding: 20px;
}

.date-events-popup.active {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: var(--bg-primary);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.date-events-popup.active .popup-content {
    transform: scale(1);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    border-radius: 16px 16px 0 0;
    z-index: 10;
}

.popup-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--text-primary);
}

.close-popup-btn {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--text-primary);
    -webkit-tap-highlight-color: rgba(0,123,255,0.2);
}

.close-popup-btn:active {
    background: var(--accent-color);
    color: white;
    transform: scale(0.95);
}

.popup-events-list {
    padding: 20px;
}

.popup-event-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.popup-event-item:last-child {
    margin-bottom: 0;
}

.event-icon-large {
    font-size: 2rem;
    flex-shrink: 0;
}

.event-details {
    flex: 1;
}

.event-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.event-type {
    font-size: 0.9rem;
    color: var(--accent-color);
}

.no-events {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Wikipedia Section */
.wikipedia-section {
    background: var(--bg-primary);
    padding: 20px 15px;
}

.wikipedia-content {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 2px 8px var(--shadow);
}

.wikipedia-content h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--accent-color);
}

.wikipedia-content p {
    line-height: 1.8;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.wikipedia-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin-top: 10px;
}

.wikipedia-link:hover {
    text-decoration: underline;
}

/* Games Section */
.games-section {
    background: var(--bg-primary);
    padding: 20px 15px;
}

.games-section h2 {
    font-size: clamp(1.1rem, 4vw, 1.3rem);
    margin-bottom: 15px;
    font-weight: 400;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
    justify-items: center;
}

.game-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px var(--shadow);
    -webkit-tap-highlight-color: rgba(0,123,255,0.2);
    width: 100%;
    max-width: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px var(--shadow);
}

.game-card:active {
    transform: scale(0.95);
    background: var(--accent-color);
    color: white;
}

.game-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    display: block;
    line-height: 1;
}

.game-card:active .game-icon {
    filter: brightness(1.2);
}

.game-card h3 {
    font-size: 1rem;
    margin: 8px 0;
    font-weight: 600;
    line-height: 1.2;
}

.game-highscore {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 8px;
    font-weight: 500;
}

.game-card:active .game-highscore {
    color: rgba(255,255,255,0.9);
}

/* Game Container */
.game-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 2000;
    overflow-y: auto;
    padding: 20px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.game-header h3 {
    flex: 1;
    text-align: center;
    margin: 0;
    font-size: 1.3rem;
}

.close-game-btn {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    -webkit-tap-highlight-color: rgba(0,123,255,0.2);
}

.close-game-btn:active {
    background: var(--accent-color);
    color: white;
    transform: scale(0.95);
}

.game-score {
    font-weight: 600;
    color: var(--accent-color);
    font-size: 1.1rem;
}

.game-controls {
    text-align: center;
    margin-top: 15px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.game-controls p {
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Typing Game Styles */
.typer-game {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.typer-text {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    font-size: 1.2rem;
    line-height: 1.8;
    min-height: 100px;
    margin-bottom: 20px;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.typer-input-wrapper {
    margin-bottom: 20px;
}

.typer-input {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    transition: border-color 0.2s;
}

.typer-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.typer-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.typer-stats {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: 600;
}

.typer-stats div {
    text-align: center;
    color: var(--text-primary);
}

.typer-stats span {
    color: var(--accent-color);
    font-size: 1.2rem;
}

.typer-start-btn {
    width: 100%;
    padding: 15px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: rgba(0,123,255,0.2);
}

.typer-start-btn:active {
    background: var(--accent-hover);
    transform: scale(0.98);
}

.typer-game-over {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    text-align: center;
    border: 2px solid var(--accent-color);
}

.typer-game-over h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.typer-game-over p {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.winner-name-input {
    width: 100%;
    max-width: 300px;
    padding: 12px;
    margin: 15px auto;
    display: block;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    text-align: center;
    transition: border-color 0.2s;
}

.winner-name-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.save-score-btn {
    padding: 12px 30px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: rgba(0,123,255,0.2);
    margin-top: 10px;
}

.save-score-btn:active {
    background: var(--accent-hover);
    transform: scale(0.98);
}

/* Daily Section */
.daily-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    background: var(--bg-primary);
    padding: 20px 15px;
}

.daily-quiz, .daily-joke {
    padding: 20px;
    background: var(--bg-secondary);
    border: none;
    border-radius: 16px;
    box-shadow: 0 2px 8px var(--shadow);
}

.daily-quiz h3, .daily-joke h3 {
    font-size: clamp(1rem, 3.5vw, 1.2rem);
    margin-bottom: 12px;
    font-weight: 400;
}

.quiz-question {
    margin-bottom: 15px;
    font-size: 1rem;
    line-height: 1.6;
}

.quiz-btn {
    padding: 12px 24px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
    min-height: 44px;
    -webkit-tap-highlight-color: rgba(0,123,255,0.2);
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

.quiz-btn:active {
    background: var(--accent-hover);
    transform: scale(0.98);
    box-shadow: 0 2px 6px rgba(0,123,255,0.3);
}

.quiz-answer {
    margin-top: 15px;
    padding: 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    display: none;
}

.quiz-answer.show {
    display: block;
}

.joke-text {
    font-size: 1rem;
    line-height: 1.6;
    font-style: italic;
    color: var(--text-secondary);
}

/* Horoscope Section */
.horoscope-section {
    padding: 20px 15px;
    background: var(--bg-primary);
}

.horoscope-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.horoscope-wheel-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

#horoscopeWheel {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 50%;
    box-shadow: 0 8px 24px var(--shadow);
}

.horoscope-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}

.current-zodiac {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 5px;
}

.current-zodiac-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-color);
}

.horoscope-controls {
    width: 100%;
    max-width: 400px;
}

.birthdate-input {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.birthdate-input label {
    font-weight: 600;
    color: var(--text-primary);
}

.birthdate-input-field {
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
}

.birthdate-input-field:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.horoscope-btn {
    padding: 12px 24px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: rgba(0,123,255,0.2);
}

.horoscope-btn:active {
    background: var(--accent-hover);
    transform: scale(0.98);
}

.horoscope-info {
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.zodiac-sign-display {
    text-align: center;
    margin-bottom: 15px;
}

.zodiac-sign-display h3 {
    font-size: 1.8rem;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.zodiac-dates {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.zodiac-description {
    color: var(--text-primary);
    line-height: 1.6;
}

.zodiac-description p {
    margin-bottom: 10px;
}

.zodiac-description strong {
    color: var(--accent-color);
}

/* Ticker Section */
.ticker-section {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 10px 0;
    overflow: hidden;
    z-index: 1000;
    box-shadow: 0 -4px 12px var(--shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ticker-content {
    display: flex;
    white-space: nowrap;
    animation: ticker 30s linear infinite;
}

.ticker-item {
    padding: 0 30px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

@keyframes ticker {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Mobile App Styling */
@media (max-width: 768px) {
    html, body {
        height: 100%;
        overflow-x: hidden;
        position: fixed;
        width: 100%;
    }
    
    body {
        padding-bottom: 50px;
        -webkit-overflow-scrolling: touch;
    }
    
    .container {
        height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Responsive - Mobile First */
@media (max-width: 480px) {
    header {
        padding: 12px 15px;
    }
    
    header h1 {
        font-size: 1.1rem;
        min-width: auto;
    }
    
    section {
        padding: 15px;
    }
    
    .world-clock {
        padding: 30px 15px;
        margin: 0 -15px;
        border-radius: 0;
    }
    
    .header-controls {
        width: 100%;
        justify-content: flex-end;
    }
    
    .world-clock {
        padding: 15px 10px;
    }
    
    .preferences-grid {
        flex-direction: column;
        width: 100%;
    }
    
    .preference-item {
        width: 100%;
    }
    
    .calendar-header {
        padding: 10px 5px;
    }
    
    .calendar-header h2 {
        font-size: 0.95rem;
    }
    
    .nav-btn {
        padding: 6px 10px;
        font-size: 1rem;
    }
    
    .holiday-display {
        flex-direction: column;
        text-align: center;
        padding: 12px;
    }
    
    .holiday-navigation {
        flex-direction: column;
    }
    
    .shabbat-info {
        flex-direction: column;
    }
    
    .shabbat-time {
        width: 100%;
        min-width: auto;
    }
    
    .daily-section {
        grid-template-columns: 1fr;
    }
    
    .ticker-item {
        padding: 0 15px;
        font-size: 0.8rem;
    }
    
    .side-menu {
        width: 280px;
        left: -280px;
    }
    
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        justify-items: stretch;
    }
    
    .game-card {
        padding: 15px 10px;
        max-width: 100%;
        min-height: 140px;
    }
    
    .game-icon {
        font-size: 2.5rem;
    }
    
    .game-card h3 {
        font-size: 0.9rem;
    }
    
    .game-highscore {
        font-size: 0.75rem;
    }
    
    .game-container {
        padding: 15px;
    }
    
    .side-menu {
        width: 280px;
        left: -280px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    .calendar-day {
        padding: 3px 1px;
        min-height: 35px;
    }
    
    .day-number {
        font-size: 0.75rem;
    }
    
    .day-events {
        font-size: 0.65rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 15px;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .time-display {
        font-size: 2rem;
    }
    
    .calendar-grid {
        gap: 2px;
        padding: 5px;
    }
    
    .calendar-day {
        min-height: 30px;
        padding: 2px;
    }
}

