/*
 * mahitTV Settings as Apple TV's Settings (settings.js; the approved plan, Step 2E), and the screensaver's extra modes
 * (saver.js). Full screen over the Frosted Horizon: dark ink on light glass by day, white on smoky glass at night.
 * No CSS variables, grid or backdrop-filter (old TVs); only transform and opacity animate.
 */

/* MARK: - The sheet: the Horizon fills it, so nothing of the home screen (the Dock) shows behind Settings. */

#settings.tvs { background: none; color: #1D1D1F; }
.night #settings.tvs { color: #FFF; }
#settings.tvs .veil { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; background: rgba(255, 255, 255, 0.1); }
.night #settings.tvs .veil { background: rgba(0, 0, 0, 0.14); }

/* MARK: - Left pane: the emblem, the title and a line about the section; the sections as capsules */

#settings .left { position: absolute; left: 96px; top: 120px; width: 568px; }
#settings .emblem {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 36px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 18px 40px rgba(22, 33, 45, 0.16), inset 0 1.5px 0 rgba(255, 255, 255, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}
.night #settings .emblem {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35), inset 0 1.5px 0 rgba(255, 255, 255, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
#settings .emblem .sym { position: absolute; left: 38px; top: 38px; background-color: #1D1D1F; }
.night #settings .emblem .sym { background-color: #FFF; }
#settings .emblem .face { position: absolute; left: 0; top: 0; width: 160px; height: 160px; background-size: cover; background-position: center; }
#settings .etitle { margin-top: 32px; font-size: 44px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; }
#settings .edesc { margin-top: 10px; font-size: 24px; font-weight: 400; line-height: 1.35; color: rgba(60, 60, 67, 0.6); min-height: 66px; }
.night #settings .edesc { color: rgba(235, 235, 245, 0.6); }
#settings .cats { margin-top: 36px; }
#settings .cat {
  position: relative;
  height: 64px;
  margin-bottom: 8px;
  padding: 0 24px;
  border-radius: 32px;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 64px;
  white-space: nowrap;
  -webkit-transform-origin: 0 50%;
  transform-origin: 0 50%;
  -webkit-transition: -webkit-transform 0.28s cubic-bezier(0.25, 1.1, 0.4, 1), background-color 0.15s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  transition: transform 0.28s cubic-bezier(0.25, 1.1, 0.4, 1), background-color 0.15s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
#settings .cat .sym { width: 30px; height: 30px; margin-right: 18px; vertical-align: -5px; background-color: currentColor; opacity: 0.8; }
/* The section shown on the right while the focus is there: a quiet capsule. */
#settings .cat.current { background: rgba(255, 255, 255, 0.4); }
.night #settings .cat.current { background: rgba(255, 255, 255, 0.18); }
#settings .cat.focus, .night #settings .cat.focus {
  background: #FFF;
  color: #1D1D1F;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  -webkit-transform: scale(1.04);
  transform: scale(1.04);
}
#settings .cat.focus .sym { opacity: 1; }

/* MARK: - Right pane: the title, then grouped inset glass with 64 px rows */

#settings .right { position: absolute; left: 744px; top: 120px; width: 1080px; height: 904px; }
#settings .rtitle { height: 64px; font-size: 46px; font-weight: 700; letter-spacing: -0.02em; line-height: 56px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#settings .view { position: absolute; left: -24px; right: -24px; top: 80px; height: 824px; overflow: hidden; }
#settings .scroll { position: absolute; left: 24px; right: 24px; top: 8px; padding-bottom: 40px; }
#settings .gh {
  margin: 30px 24px 10px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(60, 60, 67, 0.6);
}
.night #settings .gh { color: rgba(235, 235, 245, 0.6); }
#settings .gh:first-child { margin-top: 4px; }
#settings .gbox {
  position: relative;
  margin-top: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 10px 30px rgba(22, 33, 45, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}
#settings .gh + .gbox { margin-top: 0; }
.night #settings .gbox {
  background: rgba(30, 30, 35, 0.55);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
#settings .gf { margin: 12px 24px 0; font-size: 22px; font-weight: 400; line-height: 1.36; color: rgba(60, 60, 67, 0.6); }
.night #settings .gf { color: rgba(235, 235, 245, 0.6); }

#settings .srow {
  position: relative;
  height: 64px;
  padding: 0 24px;
  border-radius: 16px;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 64px;
  white-space: nowrap;
  -webkit-transition: -webkit-transform 0.26s cubic-bezier(0.25, 1.1, 0.4, 1), background-color 0.12s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  transition: transform 0.26s cubic-bezier(0.25, 1.1, 0.4, 1), background-color 0.12s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
/* The separators: inset 24 px, not under the focused row or the one after it. */
#settings .srow + .srow:before {
  content: '';
  position: absolute;
  left: 24px;
  right: 0;
  top: 0;
  height: 1px;
  background: rgba(60, 60, 67, 0.18);
}
.night #settings .srow + .srow:before { background: rgba(255, 255, 255, 0.12); }
#settings .srow.focus:before, #settings .srow.focus + .srow:before { opacity: 0; }
#settings .srow .label { display: inline-block; max-width: 640px; overflow: hidden; text-overflow: ellipsis; vertical-align: top; }
#settings .srow .end { position: absolute; right: 24px; top: 0; height: 64px; white-space: nowrap; }
#settings .srow .value { font-size: 26px; font-weight: 400; color: rgba(60, 60, 67, 0.6); }
.night #settings .srow .value { color: rgba(235, 235, 245, 0.6); }
#settings .srow .sym { display: inline-block; vertical-align: -3px; margin-left: 12px; background-color: rgba(60, 60, 67, 0.3); }
.night #settings .srow .sym { background-color: rgba(235, 235, 245, 0.3); }
#settings .srow .sym:first-child { margin-left: 0; }
/* Dim the ink, not the row, so a focused dim row still gets a solid platter. */
#settings .srow.dim .label, #settings .srow.dim .end { opacity: 0.42; }
#settings .srow.dim.focus .label, #settings .srow.dim.focus .end { opacity: 0.55; }
/* The focused row: a white platter, dark ink, a little nearer. */
#settings .srow.focus, .night #settings .srow.focus {
  background: #FFF;
  color: #1D1D1F;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  -webkit-transform: scale(1.02);
  transform: scale(1.02);
  z-index: 1;
}
#settings .srow.focus .value { color: rgba(60, 60, 67, 0.75); }
#settings .srow.focus .sym { background-color: rgba(60, 60, 67, 0.45); }
/* The check of a choice list: the system blue. */
#settings .srow .sym.check, #settings .srow.focus .sym.check { background-color: #0A84FF; }

/* The tvOS switch: 64 × 38, green when on, the knob slides (settings.js). */
#settings .switch {
  position: relative;
  display: inline-block;
  width: 64px;
  height: 38px;
  margin-top: 13px;
  border-radius: 19px;
  background: rgba(120, 120, 128, 0.32);
  -webkit-transition: background-color 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  transition: background-color 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.night #settings .switch { background: rgba(120, 120, 128, 0.36); }
#settings .switch.on, .night #settings .switch.on { background: #34C759; }
#settings .switch .knob {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 32px;
  height: 32px;
  border-radius: 16px;
  background: #FFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
}

/* Continuous corners where the TV's browser has them. */
@supports (corner-shape: superellipse(1.39)) {
  #settings .emblem { corner-shape: superellipse(1.39); border-radius: 46px; }
  #settings .gbox, #settings .srow { corner-shape: superellipse(1.39); border-radius: 20px; }
}

/* Reduce Transparency: solid panels. Tizen 2.4 (lite): no shadows or transitions. */
@media (prefers-reduced-transparency: reduce) {
  #settings .gbox, #settings .emblem { background: rgba(245, 245, 247, 0.96); }
  .night #settings .gbox, .night #settings .emblem { background: rgba(22, 22, 26, 0.97); }
}
.lite #settings .gbox, .lite #settings .emblem, .lite #settings .cat.focus, .lite #settings .srow.focus { box-shadow: none; }

/* MARK: - The screensaver's extra modes (saver.js): Aurora, Apple Aerials, Black, and the Rounded clock */

@font-face {
  font-family: 'Varela Round';
  src: url('fonts/VarelaRound-Regular.ttf') format('truetype');
  font-weight: 400;
}
#saver .aurora { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; overflow: hidden; background: #071220; }
#saver .aurora .band {
  position: absolute;
  width: 2400px;
  height: 900px;
  border-radius: 50%;
  opacity: 0.78;
}
#saver .aurora .b1 {
  left: -460px;
  top: -120px;
  background: -webkit-radial-gradient(center, ellipse, rgba(48, 209, 160, 0.55), rgba(48, 209, 160, 0) 62%);
  background: radial-gradient(ellipse at center, rgba(48, 209, 160, 0.55), rgba(48, 209, 160, 0) 62%);
  -webkit-animation: aurora1 38s ease-in-out infinite alternate;
  animation: aurora1 38s ease-in-out infinite alternate;
}
#saver .aurora .b2 {
  left: -200px;
  top: 120px;
  background: -webkit-radial-gradient(center, ellipse, rgba(94, 92, 230, 0.5), rgba(94, 92, 230, 0) 60%);
  background: radial-gradient(ellipse at center, rgba(94, 92, 230, 0.5), rgba(94, 92, 230, 0) 60%);
  -webkit-animation: aurora2 46s ease-in-out infinite alternate;
  animation: aurora2 46s ease-in-out infinite alternate;
}
#saver .aurora .b3 {
  left: -700px;
  top: 360px;
  background: -webkit-radial-gradient(center, ellipse, rgba(100, 210, 255, 0.4), rgba(100, 210, 255, 0) 60%);
  background: radial-gradient(ellipse at center, rgba(100, 210, 255, 0.4), rgba(100, 210, 255, 0) 60%);
  -webkit-animation: aurora3 54s ease-in-out infinite alternate;
  animation: aurora3 54s ease-in-out infinite alternate;
}
@-webkit-keyframes aurora1 { from { -webkit-transform: translate(0, 0) rotate(-8deg) scale(1); } to { -webkit-transform: translate(420px, 60px) rotate(4deg) scale(1.12); } }
@keyframes aurora1 { from { transform: translate(0, 0) rotate(-8deg) scale(1); } to { transform: translate(420px, 60px) rotate(4deg) scale(1.12); } }
@-webkit-keyframes aurora2 { from { -webkit-transform: translate(0, 0) rotate(6deg) scale(1.05); } to { -webkit-transform: translate(-360px, -80px) rotate(-6deg) scale(0.94); } }
@keyframes aurora2 { from { transform: translate(0, 0) rotate(6deg) scale(1.05); } to { transform: translate(-360px, -80px) rotate(-6deg) scale(0.94); } }
@-webkit-keyframes aurora3 { from { -webkit-transform: translate(0, 0) rotate(-4deg); } to { -webkit-transform: translate(520px, -120px) rotate(8deg); } }
@keyframes aurora3 { from { transform: translate(0, 0) rotate(-4deg); } to { transform: translate(520px, -120px) rotate(8deg); } }
.lite #saver .aurora .band { -webkit-animation: none; animation: none; }

#saver.black { background: #000; }
#saver.black .clock, .night #saver.black .clock {
  background: none;
  box-shadow: none;
  color: rgba(255, 255, 255, 0.55);
  -webkit-transition: -webkit-transform 3s ease-in-out;
  transition: transform 3s ease-in-out;
}
#saver.black .clock .date { color: rgba(255, 255, 255, 0.45); }

/* Over the aurora and the aerials, the clock is the photos' glass. */
#saver.aurora-on .clock, #saver.aerials-on .clock { color: #FFF; }

/* MARK: - Floating Sidebar (Appearance & Startup → Settings Style): a Liquid Glass sidebar at x 1080–1840 (under the pill) over the live
   home screen (wallpaper and Dock stay, dimmed); the sections, then a section's rows, one pane at a time. */
#settings.sidebar .hz, #settings.sidebar .veil { display: none; }
#settings.sidebar .side {
  position: absolute;
  left: 1080px;
  top: 124px;
  width: 760px;
  height: 916px;
  border-radius: 40px;
  background: rgba(246, 247, 250, 0.95);
  box-shadow: 0 40px 90px rgba(22, 33, 45, 0.3), inset 1.5px 1.5px 0 rgba(255, 255, 255, 0.9), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.night #settings.sidebar .side { background: rgba(30, 35, 48, 0.95); box-shadow: 0 40px 90px rgba(0, 0, 0, 0.45), inset 1.5px 1.5px 0 rgba(255, 255, 255, 0.22), inset 0 0 0 1px rgba(255, 255, 255, 0.1); }
.frosted #settings.sidebar .side { box-shadow: 0 40px 90px rgba(0, 0, 0, 0.3); }
#settings.sidebar .left, #settings.sidebar .right { -webkit-transition: opacity 0.2s cubic-bezier(0.22, 1, 0.36, 1); transition: opacity 0.2s cubic-bezier(0.22, 1, 0.36, 1); }
#settings.sidebar .left { left: 1128px; top: 164px; width: 664px; }
#settings.sidebar .emblem { width: 96px; height: 96px; border-radius: 22px; }
#settings.sidebar .emblem .sym { left: 22px; top: 22px; width: 52px !important; height: 52px !important; }
#settings.sidebar .emblem .face { width: 96px; height: 96px; }
#settings.sidebar .etitle { margin-top: 20px; font-size: 36px; }
#settings.sidebar .edesc { min-height: 0; font-size: 21px; }
#settings.sidebar .cats { margin-top: 28px; }
#settings.sidebar .right { left: 1128px; top: 164px; width: 664px; height: 840px; }
#settings.sidebar .rtitle { font-size: 38px; }
#settings.sidebar .rtitle .back { display: inline-block; width: 26px; height: 26px; margin-right: 12px; vertical-align: 2px; opacity: 0.5; -webkit-transform: scaleX(-1); transform: scaleX(-1); }
#settings.sidebar .view { height: 760px; }
#settings.sidebar .srow .label { max-width: 380px; }
#settings.sidebar.on-cats .right, #settings.sidebar .left { opacity: 0; visibility: hidden; }
#settings.sidebar.on-cats .left { opacity: 1; visibility: visible; }
.sheet#settings.sidebar { background: rgba(22, 33, 45, 0.18); }

/* Text Size (Settings → Appearance, tvOS 27): the text at 90 % or 115 % (no CSS variables on old TVs). */
.text-small #settings .etitle { font-size: 40px; }
.text-small #settings .edesc { font-size: 22px; }
.text-small #settings .cat { font-size: 25px; }
.text-small #settings .rtitle { font-size: 41px; }
.text-small #settings .gh { font-size: 18px; }
.text-small #settings .gf { font-size: 20px; }
.text-small #settings .srow { font-size: 25px; }
.text-small #settings .srow .value { font-size: 23px; }
.text-small #settings.sidebar .etitle { font-size: 32px; }
.text-small #settings.sidebar .edesc { font-size: 19px; }
.text-small #settings.sidebar .rtitle { font-size: 34px; }
.text-large #settings .etitle { font-size: 51px; }
.text-large #settings .edesc { font-size: 28px; }
.text-large #settings .cat { font-size: 32px; }
.text-large #settings .rtitle { font-size: 53px; }
.text-large #settings .gh { font-size: 23px; }
.text-large #settings .gf { font-size: 25px; }
.text-large #settings .srow { font-size: 32px; }
.text-large #settings .srow .value { font-size: 30px; }
.text-large #settings.sidebar .etitle { font-size: 41px; }
.text-large #settings.sidebar .edesc { font-size: 24px; }
.text-large #settings.sidebar .rtitle { font-size: 44px; }
