.icon { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none; display: inline-block; }
.icon-solid { fill: currentColor; stroke: none; }
.icon-sm { width: 20px; height: 20px; }

#splash-screen { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-color: #293132; z-index: 9999; display: flex; justify-content: center; align-items: center; transition: opacity 0.8s ease, visibility 0.8s; }
#splash-screen img { max-width: 400px; width: 60%; height: auto; }

html, body { width: 100%; height: 100%; margin: 0; padding: 0; transition: background-color 0.8s ease; position: fixed; overflow: hidden; touch-action: none; }
body { color: #e0e0e0; font-family: 'Cabin', sans-serif; display: flex; justify-content: center; align-items: center; overscroll-behavior: none; -webkit-user-select: none; user-select: none; }

.app-container { width: 100%; max-width: 380px; height: auto; max-height: 100vh; padding: calc(env(safe-area-inset-top) + 20px) 20px calc(env(safe-area-inset-bottom) + 20px) 20px; box-sizing: border-box; display: flex; flex-direction: column; gap: 20px; overflow-y: auto; scrollbar-width: none; position: relative; z-index: 10; touch-action: pan-y; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; }
.app-container::-webkit-scrollbar { display: none; }

.card { background: rgba(20, 20, 20, 0.65); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 20px; border-radius: 16px; position: relative; box-shadow: 0 8px 32px rgba(0,0,0,0.15); transition: background 0.5s ease, color 0.5s ease; }
.station-card { padding-bottom: 40px; }
.ambient-card { margin-top: 15px; padding-top: 45px; text-align: center; }
.mini-card { padding: 12px 20px; }

.main-play-btn { position: absolute; top: -68px; left: 50%; transform: translateX(-50%); width: 86px; height: 86px; border-radius: 50%; background: rgba(0, 229, 255, 0.9); color: #121212; border: 8px solid rgba(20, 20, 20, 0.65); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); z-index: 20; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s ease; }
.main-play-btn:hover { background: rgba(0, 229, 255, 1); transform: translateX(-50%) scale(1.05); }
.main-play-btn svg { width: 36px; height: 36px; }

.header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; gap: 8px; }
select, .search-input { width: 100%; padding: 10px; margin: 0; background: rgba(0,0,0,0.5); color: #fff; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; font-family: inherit; font-size: 0.95em; outline: none; }
select { cursor: pointer; }
select option { background: #1e1e1e; color: #fff; }
optgroup { background: #121212; color: #00e5ff; font-style: normal; font-weight: 600; }

.mini-btn { background: rgba(0, 229, 255, 0.6); border: none; border-radius: 8px; color: white; padding: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.mini-btn:hover { background: rgba(0, 229, 255, 1); }
.mini-btn.close-btn { background: rgba(255, 82, 82, 0.4); }
.mini-btn.close-btn:hover { background: rgba(255, 82, 82, 0.8); }

.search-result-item { display: flex; justify-content: space-between; align-items: center; padding: 8px; border-bottom: 1px solid rgba(255,255,255,0.1); font-size: 0.8em; }
.search-result-item span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 65%; text-align: left; }
.action-btns { display: flex; gap: 5px; }
.action-btns .mini-btn { padding: 8px; }
.results-container { max-height: 200px; overflow-y: auto; background: rgba(0,0,0,0.3); border-radius: 8px; margin-bottom: 10px; overscroll-behavior: contain; }
.results-container::-webkit-scrollbar { display: none; }
.manager-heading { color: #84ffff; font-size: 0.8em; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; padding: 10px; border-bottom: 1px solid rgba(255,255,255,0.1); text-align: left; margin: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; gap: 6px; }

.ambient-controls { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 20px; }
.ambient-btn, .ambient-btn.active { flex: 1; height: 44px; max-width: 50px; background: rgba(40, 40, 40, 0.8) !important; color: white !important; position: relative; overflow: hidden; touch-action: none; border: none; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.ambient-btn::before { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: var(--vol, 50%); background: rgba(0, 229, 255, 0.3) !important; z-index: 1; transition: background 0.3s ease; }
.ambient-btn.active::before { background: rgba(0, 229, 255, 0.9) !important; }
.ambient-btn svg { position: relative; z-index: 2; pointer-events: none; filter: drop-shadow(0px 1px 3px rgba(0,0,0,0.8)); }

#binauralDrawer { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; display: flex; flex-direction: column; gap: 10px; }
#binauralDrawer.open { max-height: 180px; margin-top: 5px; margin-bottom: 20px; }
.binaural-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.wave-btn { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: #888; padding: 10px 2px; border-radius: 6px; font-size: 0.55em; font-weight: 700; text-transform: uppercase; cursor: pointer; transition: 0.2s; text-align: center; }
.wave-btn.active { background: rgba(0, 229, 255, 0.2); border-color: #00e5ff; color: #fff; }

.volume-container { display: flex; align-items: center; gap: 8px; color: #bbb; justify-content: center; }
input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; touch-action: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; height: 14px; width: 14px; border-radius: 50%; background: #00e5ff; cursor: pointer; margin-top: -5px; box-shadow: 0 2px 5px rgba(0,0,0,0.3); }
input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 4px; cursor: pointer; background: rgba(255, 255, 255, 0.2); border-radius: 4px; }

.timer-container { position: relative; width: 100%; margin: 0 auto 20px auto; display: flex; justify-content: center; align-items: center; }
.timer-svg { width: 100%; height: auto; overflow: visible; display: block; }
.timer-track { fill: none; stroke: rgba(255,255,255,0.1); stroke-width: 4; stroke-linecap: round; }
.timer-progress { fill: none; stroke: #00e5ff; stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.timer-display { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 100%; text-align: center; font-size: 2.8em; font-weight: 700; color: #fff; font-family: ui-rounded, system-ui, sans-serif; font-variant-numeric: tabular-nums; line-height: 1; z-index: 2; }
.timer-display.active-border { -webkit-text-stroke: 1px #000; text-shadow: 0px 2px 4px rgba(0,0,0,0.5); }

body.light-theme .timer-display.active-border { -webkit-text-stroke: 1px #fff; }
.timer-btn-group { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.timer-btn { background: rgba(60, 60, 60, 0.6); border: 1px solid transparent; color: #fff; padding: 8px; width: 44px; height: 44px; border-radius: 8px; cursor: pointer; transition: 0.2s; font-family: inherit; font-weight: 600; font-size: 0.9em; display: flex; align-items: center; justify-content: center; }
.timer-btn:hover { background: rgba(0, 229, 255, 0.8); color: #121212; transform: translateY(-2px); }
.timer-btn.active-timer { background: rgba(0, 229, 255, 1); color: #121212; }
.timer-btn.stop-btn { background: rgba(255, 82, 82, 0.3); color: #ff8a8a; }
.timer-btn.stop-btn:hover { background: rgba(255, 82, 82, 0.8); color: #fff; }

.appearance-grid { display: flex; justify-content: space-between; gap: 10px; }
.appearance-btn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: transparent; border: 1px solid rgba(255,255,255,0.1); color: #bbb; font-size: 0.75em; padding: 12px 5px; border-radius: 8px; cursor: pointer; transition: 0.3s; font-family: inherit; font-weight: 600; }
.appearance-btn:hover, .appearance-btn.active { background: rgba(255,255,255,0.1); color: #fff; }
.utility-btn { flex-direction: row; padding: 10px 5px; gap: 8px; font-size: 0.8em; }

#customTimeModal, #statsModal, #aboutModal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.7); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); z-index: 10000; display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s; padding: 20px; box-sizing: border-box; }
#customTimeModal.active, #statsModal.active, #aboutModal.active { opacity: 1; visibility: visible; }
.modal-card { width: 100%; max-width: 300px; text-align: center; padding: 25px 20px; display: flex; flex-direction: column; max-height: 80vh; }
.modal-title { margin-bottom: 20px; font-weight: 600; font-size: 1.1em; color: #fff; text-transform: uppercase; letter-spacing: 1px; flex-shrink: 0; }
.about-content { overflow-y: auto; text-align: left; color: #ccc; font-size: 0.9em; line-height: 1.5; margin-bottom: 20px; overscroll-behavior: contain; }
.about-content::-webkit-scrollbar { display: none; }
.modal-input { width: 100%; padding: 15px; margin-bottom: 20px; box-sizing: border-box; background: rgba(0,0,0,0.5); color: #fff; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; font-family: inherit; font-size: 1.4em; text-align: center; outline: none; transition: 0.2s; }
.modal-input:focus { border-color: #00e5ff; box-shadow: 0 0 10px rgba(0,229,255,0.2); }
.modal-actions { display: flex; gap: 10px; flex-shrink: 0; }
.modal-actions .mini-btn { flex: 1; padding: 12px; font-weight: 600; font-size: 1em; }
.stat-row { display: flex; justify-content: space-between; align-items: center; font-size: 1.2em; color: #fff; margin-bottom: 12px; padding: 12px 15px; background: rgba(0,0,0,0.3); border-radius: 8px; }
.stat-row strong { color: #00e5ff; font-weight: 700; font-size: 1.1em; }

body.light-theme .card { background: rgba(255, 255, 255, 0.7); color: #121212; }
body.light-theme .main-play-btn { border-color: rgba(255, 255, 255, 0.7); }
body.light-theme .timer-display { color: #121212; }
body.light-theme select, body.light-theme .search-input, body.light-theme .modal-input { background: rgba(255,255,255,0.5); color: #121212; border-color: rgba(0,0,0,0.1); }
body.light-theme .modal-title { color: #333; }
body.light-theme .about-content { color: #555; }
body.light-theme .appearance-btn { color: #444; border-color: rgba(0,0,0,0.1); }
body.light-theme .appearance-btn:hover { background: rgba(0,0,0,0.05); color: #121212; }
body.light-theme .timer-btn { background: rgba(0,0,0,0.1); color: #333; }
body.light-theme .timer-btn:hover { background: rgba(0, 229, 255, 0.8); }
body.light-theme .timer-btn.active-timer { background: rgba(0, 229, 255, 1); color: #121212; }
body.light-theme .timer-track { stroke: rgba(0,0,0,0.1); }
body.light-theme .stat-row { color: #121212; background: rgba(255,255,255,0.5); }
body.light-theme .stat-row strong { color: #008b99; }
body.light-theme .wave-btn { border-color: rgba(0,0,0,0.1); color: #666; }

body.night-mode { background-color: #000 !important; }
body.night-mode .app-container, body.night-mode #zenDisplay { filter: grayscale(100%) brightness(0.35); }
body.night-mode #zenDisplay { background: rgba(0,0,0,0.95); }

#zenDisplay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; opacity: 0; pointer-events: none; z-index: 999; transition: opacity 0.8s ease, filter 0.8s ease; background: rgba(0,0,0,0.8); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); cursor: pointer; }
#zenTime { font-size: 28vmin; font-weight: 700; color: #fff; font-family: ui-rounded, system-ui, sans-serif; font-variant-numeric: tabular-nums; line-height: 1; text-shadow: 0 4px 20px rgba(0,0,0,0.5); }
#zenStatus { font-size: 5vmin; font-weight: 600; color: #00e5ff; margin-top: 20px; letter-spacing: 6px; text-transform: uppercase; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }

body.zen-active .app-container { opacity: 0; pointer-events: none; transform: scale(0.95); transition: 0.5s ease; }
body.zen-active #zenDisplay { opacity: 1; pointer-events: auto; }