/* === Alta Badia 2026 — Dark Mode === */
:root {
    color-scheme: dark;
    --bg: #0b0e12;
    --bg-tab: #111418;
    --bg-card: rgba(255, 255, 255, 0.04);
    --border: rgba(255, 255, 255, 0.10);
    --text: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent: #58a6ff;
    --wx-ico: 18px;
}
@media (max-width: 480px) {
    :root { --wx-ico: 16px; }
}

html {
    overscroll-behavior-y: contain;
}
body {
    font-family: -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* === Tab Bar === */
.tab {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    gap: 4px;
    padding: 8px 6px;
    background: var(--bg-tab);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.tab::-webkit-scrollbar { display: none; }

.tab button {
    flex: 1 0 auto;
    min-width: 44px;
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}
.tab button:hover {
    background: rgba(255, 255, 255, 0.06);
}
.tab button.active {
    background: rgba(56, 139, 253, 0.15);
    color: var(--accent);
    font-weight: 600;
}

/* === Tab Content === */
.tabcontent {
    display: none;
    padding: 0 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* === Typography === */
h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: 16px 10px 8px;
}
h4 {
    font-size: 15px;
    font-weight: 600;
    color: #d1d5db;
    margin: 14px 10px 6px;
}
p {
    margin: 6px 10px;
    color: var(--text-secondary);
    font-size: 14px;
}
small {
    color: var(--text-muted);
}
hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin: 14px 10px;
}
a {
    color: var(--accent);
    text-decoration: none;
}

/* === Card Row (flex wrapper for icon cards) === */
.card-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 10px;
}

/* === Icon Cards === */
.ic128 {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 calc((100% - 16px) / 3);
    min-height: 104px;
    padding: 10px 6px 8px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-card);
    text-align: center;
    vertical-align: top;
    overflow: hidden;
    box-sizing: border-box;
    -webkit-user-select: none;
    user-select: none;
}
.ic128:active {
    background: rgba(255, 255, 255, 0.08);
}
.ic128 img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    margin-bottom: 4px;
}
.ic128 img[src$=".svg"] {
    filter: invert(1);
}
.ic128 b {
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.3;
}
.ic128 > a[href^="tel:"] {
    display: block;
    font-size: 11px;
    color: var(--accent);
}

/* Webcam thumbnails — fill card width, don't invert */
.ic128 img.icVid {
    width: 100%;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    filter: none;
}

/* PNG icons — invert for dark mode */
.ic128 img[src$=".png"] {
    filter: invert(0.85);
}

/* === Ski Components (web components become transparent wrappers) === */
ski-lift, ski-run {
    display: contents;
}

/* === Ski Lift Cards === */
.ic128g {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 calc((100% - 16px) / 3);
    min-height: 104px;
    padding: 8px 4px 6px;
    border-radius: 14px;
    border: 1px solid rgba(168, 85, 247, 0.3) !important;
    background: rgba(168, 85, 247, 0.06) !important;
    color: #c4b5fd;
    vertical-align: top;
    overflow: hidden;
    box-sizing: border-box;
}
.ic128g img {
    max-width: 48px;
    max-height: 48px;
    object-fit: contain;
    filter: invert(0.85);
}

/* === Ski Run Cards === */
.ic200b, .ic200r, .ic200k {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 calc((100% - 16px) / 3);
    min-height: 104px;
    padding: 8px 4px 6px;
    border-radius: 14px;
    vertical-align: top;
    overflow: hidden;
    box-sizing: border-box;
}
.ic200b {
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    background: rgba(59, 130, 246, 0.12) !important;
    color: #93c5fd;
}
.ic200r {
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    background: rgba(239, 68, 68, 0.12) !important;
    color: #fca5a5;
}
.ic200k {
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    background: rgba(255, 255, 255, 0.06) !important;
    color: #d1d5db;
}
.ic200b img, .ic200r img, .ic200k img {
    max-width: 48px;
    max-height: 48px;
    object-fit: contain;
    filter: invert(0.85);
}

/* === Size Utilities === */
.small { font-size: 11px; }
.large { font-size: 14px; }

/* === Countdown Timer === */
#countdown {
    text-align: center;
    padding: 12px 10px 8px;
}
#countdown .cd-title {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
#countdown .cd-row {
    display: flex;
    justify-content: center;
    gap: 8px;
}
#countdown .cd-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 56px;
}
#countdown .cd-num {
    font-size: 32px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    line-height: 1.1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px 10px;
}
#countdown .cd-label {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
#countdown .cd-sep {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-muted);
    align-self: flex-start;
    padding-top: 8px;
}

/* === Pre page — no scroll === */
.pre-page {
    height: calc(100vh - 42px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.pre-page .hero-img {
    flex: 1;
    min-height: 0;
    object-fit: cover;
    border-radius: 12px;
    margin: 0 10px;
}

/* === Small icon cards (SIMs) — 3 per row === */
.ic-sm {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 72px;
    min-height: 72px;
    padding: 6px 4px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card);
    text-align: center;
    overflow: hidden;
}
.ic-sm img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    margin-bottom: 2px;
    filter: invert(1);
}
.ic-sm b {
    font-size: 10px;
    font-weight: 500;
    color: var(--text);
}

/* === Hero image === */
.hero-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0 0 16px 16px;
}

/* === Samsung Galaxy Optimizations === */
@media (max-width: 412px) {
    .tab button { font-size: 12px; padding: 8px 8px; }
}
@media (max-width: 374px) {
    .tab button { font-size: 11px; padding: 6px 6px; }
}

/* ================================================================
   Weather Widget Styles
   ================================================================ */
.wx-sr {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}
.wx-row-icons {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
}
.wx-icon-main {
    width: calc(var(--wx-ico) + 4px) !important;
    height: calc(var(--wx-ico) + 4px) !important;
    object-fit: contain;
    vertical-align: middle;
    opacity: 1;
    filter: drop-shadow(0 0 0.75px rgba(255, 255, 255, 0.18));
}
.wx-chip {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.wx-chip svg {
    width: 20px; height: 20px;
    display: block;
}
.wx-num {
    font: 600 clamp(13px, 2.4vw, 16px) / 1 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
.wx-empty {
    font: 500 12px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    opacity: 0.6;
}
.wx-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.wx-link:focus-visible {
    outline: 2px solid rgba(88, 156, 255, 0.7);
    outline-offset: 2px;
    border-radius: 8px;
}
.wx-link, .wx-link:link, .wx-link:visited, .wx-link:hover, .wx-link:active {
    color: inherit !important;
    text-decoration: none !important;
}
.wx-row-icons svg, .wx-row-icons img {
    width: var(--wx-ico) !important;
    height: var(--wx-ico) !important;
    flex: 0 0 var(--wx-ico);
    max-width: none !important;
}
.wx-ico {
    width: var(--wx-ico) !important;
    height: var(--wx-ico) !important;
}
.wx-ico-sun {
    width: calc(var(--wx-ico) - 1px) !important;
    height: calc(var(--wx-ico) - 1px) !important;
}
