@media (min-width:721px) {
  .rail-right .rail-portal-slot#cup-history[data-portal-study-ready="true"] { position:relative;display:block;flex:0 0 33.333vh;min-height:0;padding:14px 14px 12px;overflow:hidden;pointer-events:auto;background:none;border:0; }
  .portal-module { width:100%;height:100%;position:relative;color:var(--ui-text,#eeede8);outline-offset:-2px; }
  .portal-stage { position:relative;width:100%;height:100%;perspective:900px;touch-action:pan-y;cursor:grab; }
  .portal-stage.is-dragging { cursor:grabbing;user-select:none; }
  .portal-track { position:relative;width:100%;height:100%;transform-style:preserve-3d; }
  .portal-face { position:absolute;inset:0;display:grid;grid-template-rows:52px minmax(0,1fr) 32px;overflow:hidden;backface-visibility:hidden;-webkit-backface-visibility:hidden;border-radius:18px;background:linear-gradient(135deg,rgba(49,61,71,.90),rgba(18,26,35,.94) 54%,rgba(23,32,42,.96));box-shadow:inset 0 1px rgba(255,255,255,.14),inset 0 0 0 1px rgba(226,233,239,.09),0 12px 35px rgba(0,0,0,.12); }
  .portal-face::after { content:"";position:absolute;inset:0;pointer-events:none;border-radius:inherit;background:linear-gradient(115deg,rgba(231,236,239,.16),transparent 40%,rgba(209,178,123,.06));opacity:var(--portal-sheen,.35); }
  .portal-face[aria-hidden="true"] { pointer-events:none; }
  .portal-face-header { display:flex;align-items:center;padding:0 88px 0 18px;min-width:0; }
  .portal-face-header h2 { margin:0;color:var(--ui-text,#eeede8);font-size:18px;font-weight:600;letter-spacing:0;white-space:nowrap; }
  .portal-navigation { position:absolute;right:10px;top:11px;display:flex;gap:2px;z-index:4; }
  .portal-nav-button { display:grid;place-items:center;width:32px;height:32px;border:0;border-radius:9px;background:transparent;color:var(--ui-muted,#a3a9b1);padding:5px;cursor:pointer;transition:background 160ms var(--ui-ease-out),transform 160ms var(--ui-ease-out),color 160ms var(--ui-ease-out); }
  .portal-nav-button svg { width:18px;height:18px; }
  .portal-nav-button:active { transform:scale(.94);background:rgba(255,255,255,.08); }
  .portal-body { min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:rgba(190,205,217,.22) transparent;padding:0 18px;overscroll-behavior:contain; }
  .portal-tabs { display:grid;grid-template-columns:1fr 1fr;padding:3px;background:rgba(5,11,17,.34);border-radius:10px;margin:0 0 8px;gap:3px; }
  .portal-tabs button { height:32px;border:0;background:transparent;color:var(--ui-muted);border-radius:7px;font:inherit;font-size:13px;cursor:pointer;transition:background 180ms var(--ui-ease-out),color 160ms var(--ui-ease-out); }
  .portal-tabs button[aria-selected="true"] { background:rgba(222,231,239,.12);box-shadow:0 1px 3px #0003;color:var(--ui-text); }
  .portal-match-row,.portal-history-row { display:flex;align-items:center;gap:10px;min-width:0;min-height:74px;padding:9px 0;color:inherit;text-decoration:none;border:0;border-bottom:1px solid rgba(225,235,245,.075);background:transparent;width:100%;text-align:left;font:inherit;cursor:pointer; }
  .portal-match-row:last-child { border-bottom:0; }
  .portal-teams { display:grid;grid-template-columns:minmax(0,1fr);gap:0;min-width:0;flex:1;font-size:15px;font-weight:450;line-height:1.4; }
  .portal-history-row { padding-top:6px;padding-bottom:6px; }
  .portal-face[data-portal-page="history"] .portal-body { overflow-y:auto; max-height:calc(33.333vh - 84px); scrollbar-width:thin; }
  .portal-teams>span { overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
  .portal-teams>small { color:var(--ui-muted);font-size:12px;font-weight:400;line-height:1.6; }
  .portal-match-time { display:grid;gap:3px;justify-items:end;flex-shrink:0;font-variant-numeric:tabular-nums; }
  .portal-match-time strong { font-size:16px;font-weight:500; }
  .portal-match-time small { color:var(--ui-muted);font-size:12px; }
  .portal-score { font-size:22px;letter-spacing:-.03em;font-weight:550;white-space:nowrap;font-variant-numeric:tabular-nums; }
  .portal-row-chevron { display:grid;place-items:center;width:12px;color:var(--ui-muted);transition:transform 180ms var(--ui-ease-out); }
  .portal-row-chevron svg { width:14px;height:14px; }
  [aria-expanded="true"] .portal-row-chevron { transform:rotate(180deg);color:var(--ui-accent); }
  .portal-history-row[aria-expanded="true"] { color:#f8f4e9;background:rgba(219,229,239,.055); }
  .portal-summary { overflow:hidden; }
  .portal-summary[hidden] { display:none; }
  .portal-history-detail { display:grid;grid-template-columns:1fr 1fr;gap:6px 8px;margin:0;padding:8px 0;background:none; }
  .portal-history-detail>div { min-width:0; }
  .portal-history-detail dt { font-size:12px;color:var(--ui-muted);margin-bottom:3px; }
  .portal-history-detail dd { margin:0;font-size:14px;line-height:1.5;color:var(--ui-text); }
.portal-history-detail dd.portal-probability { font-size:22px;font-weight:500;font-variant-numeric:tabular-nums; }
.portal-history-detail dd.portal-odds { font-size:24px;font-weight:500;font-variant-numeric:tabular-nums;color:var(--ui-text); }
.portal-history-detail dd.portal-kelly-capsule { display:inline-flex;align-items:center;min-height:30px;padding:4px 10px;border-radius:999px;background:#4ca47b;color:#fff;font-size:16px;font-weight:650;font-variant-numeric:tabular-nums; }
.portal-history-detail dd.portal-kelly-capsule.is-positive { background:#ed5d5f; }
.portal-history-detail dd.portal-kelly-capsule.is-negative { background:#4ca47b; }
.portal-history-detail dd.portal-probability.is-model { color:#ed6a68; }
.portal-score,.portal-match-time strong,.portal-probability,.portal-odds,.portal-kelly-capsule { font-family:"DM Sans","Avenir Next","Segoe UI Variable",sans-serif; font-variant-numeric:tabular-nums; }
  .portal-history-detail dd.is-model { color:var(--ui-accent); }
  .portal-saved-at { grid-column:1/-1;display:flex;justify-content:space-between;gap:8px; }
  .portal-saved-at dd { font-size:12px; }
  .portal-summary-missing { margin:0;padding:16px 0;color:var(--ui-muted);font-size:13px; }
  .portal-face-footer { display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 18px;color:var(--ui-muted);font-size:12px; }
  .portal-dots { display:flex;gap:0;margin-left:-5px; }
  .portal-dot { display:grid;place-items:center;width:20px;height:26px;padding:0;border:0;background:transparent;cursor:pointer; }
  .portal-dot span { display:block;width:4px;height:4px;border-radius:6px;background:#75818e;transition:background 160ms var(--ui-ease-out),transform 160ms var(--ui-ease-out); }
  .portal-dot[aria-current="true"] span { background:var(--ui-accent);transform:scaleX(2.2); }
  .portal-all-link { padding:4px 0;text-decoration:none;color:var(--ui-text);font-size:12px; }
  .portal-empty { min-height:0;height:100%;display:grid;align-content:center;justify-items:center;gap:14px;color:var(--ui-muted);font-size:13px; }
  .portal-empty button { padding:6px 10px;color:var(--ui-text);background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.09);border-radius:8px;font:inherit;cursor:pointer; }
  .portal-account { padding-top:4px; }
  .portal-account-identity { display:flex;align-items:center;gap:12px; }
  .portal-avatar { display:grid;place-items:center;width:40px;height:40px;flex:0 0 auto;border-radius:50%;background:rgba(204,219,232,.09);color:#c5cdd6; }
  .portal-avatar svg { width:24px;height:24px; }
  .portal-account-identity strong { font-size:16px;font-weight:550; }
  .portal-account-identity p { margin:4px 0 0;font-size:12px;color:var(--ui-muted); }
  .portal-account-balance { display:flex;justify-content:space-between;align-items:center;padding:14px 0;font-size:13px;color:var(--ui-muted); }
  .portal-account-balance strong { font-size:22px;line-height:1;color:var(--ui-text);font-weight:400; }
  .portal-login { display:flex;align-items:center;justify-content:space-between;width:100%;height:36px;padding:0 12px;border:1px solid rgba(213,226,238,.12);border-radius:9px;background:rgba(204,219,232,.08);color:var(--ui-text);font:inherit;font-size:13px;cursor:pointer;transition:transform 160ms var(--ui-ease-out),background 160ms var(--ui-ease-out); }
  .portal-login svg { width:16px;height:16px; }
  .portal-login:active { transform:scale(.98); }
  .portal-account-notice { margin:9px 0 0;font-size:12px;color:var(--ui-muted); }
  .portal-sr-only { position:absolute;clip-path:inset(50%);width:1px;height:1px;overflow:hidden;white-space:nowrap; }
  .portal-module.is-reduced .portal-track { transform:none!important; }
  .portal-module.is-reduced .portal-face { transform:none!important;visibility:hidden; }
  .portal-module.is-reduced .portal-face.is-current { visibility:visible; }
  .portal-history-popover { position:fixed;z-index:900;box-sizing:border-box;width:332px;max-width:calc(100vw - 24px);max-height:calc(100vh - 24px);overflow:hidden;padding:18px;border:1px solid rgba(226,233,239,.12);border-radius:14px;background:rgba(24,33,41,.97);color:var(--ui-text);box-shadow:0 12px 40px #0005;transform-origin:top right;font-family:var(--ui-font); }
  .portal-preview-content { height:100%;min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:rgba(190,205,217,.22) transparent;overscroll-behavior:contain; }
  .portal-history-popover[hidden] { display:none; }
  .portal-history-popover[inert] { pointer-events:none; }
  .portal-preview-header { display:flex;align-items:flex-start;gap:8px;padding-bottom:14px;border-bottom:1px solid rgba(226,233,239,.09); }
  .portal-preview-header>div { flex:1;min-width:0; }
  .portal-preview-header p { margin:0 0 8px;color:var(--ui-muted);font-size:12px; }
  .portal-preview-header h3 { margin:0;font-size:16px;font-weight:500;line-height:1.65;overflow-wrap:anywhere; }
  .portal-preview-header h3 span { padding:0 3px;color:var(--ui-accent);font-variant-numeric:tabular-nums; }
  .portal-preview-header button { display:grid;place-items:center;width:28px;height:28px;flex-shrink:0;padding:0;border:0;border-radius:7px;background:transparent;color:var(--ui-muted);font:22px/1 var(--ui-font);cursor:pointer; }
  .portal-history-popover .portal-history-detail { padding:16px 0;gap:14px 10px; }
  .portal-history-popover .portal-history-detail dd { font-size:15px; }
  .portal-history-popover .portal-history-detail .portal-probability { font-size:22px; }
  .portal-history-popover .portal-saved-at dd { font-size:12px; }
  .portal-history-popover footer { display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0;padding-top:12px;border-top:1px solid rgba(226,233,239,.09);font-size:12px;color:var(--ui-muted); }
  .portal-history-popover footer a { color:var(--ui-text);text-decoration:none; }
}
@media (min-width:721px) and (hover:hover) and (pointer:fine) {
  .portal-nav-button:hover { color:var(--ui-text);background:rgba(231,236,242,.08); }
  .portal-match-row:hover,.portal-history-row:hover { color:#fff; }
  .portal-login:hover { background:rgba(220,231,240,.14); }
  .portal-all-link:hover { color:var(--ui-accent); }
}
@media (prefers-reduced-motion:reduce) { .portal-row-chevron,.portal-dot span,.portal-nav-button,.portal-tabs button,.portal-login { transition:none; } }

/* Clarity study: the upper card floats directly over the scene. Frost belongs
   to an individual surface, never to both that surface and its whole rail. */
@media (min-width:721px) {
  .atlas-layout > .rail.rail-right { background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none;border-left:0; }
  .rail-right::before { content:"";position:absolute;inset:33.333vh 0 0;pointer-events:none;background:linear-gradient(270deg,rgba(12,18,25,.65),rgba(12,18,25,.3));backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px); }
  .rail-right > .rail-header,.rail-right > .rail-viewport { position:relative;z-index:1; }
  .rail-right .rail-portal-slot#cup-history[data-portal-study-ready="true"] { flex-basis:max(184px,33.333vh);min-height:184px;padding:18px 16px 14px;overflow:visible;z-index:3; }
  .portal-stage { perspective:1100px;perspective-origin:50% 46%; }
  .portal-face { grid-template-rows:54px minmax(0,1fr) 32px;border-radius:22px;
    background:linear-gradient(142deg,rgba(196,215,229,.12),rgba(34,49,63,.24) 38%,rgba(15,26,39,.34) 80%,rgba(160,180,197,.10));
    backdrop-filter:blur(18px) saturate(1.16);-webkit-backdrop-filter:blur(18px) saturate(1.16);
    box-shadow:inset 0 1px 1px rgba(255,255,255,.30),inset 1px 0 0 rgba(236,245,255,.12),inset -1px -1px 1px rgba(210,230,248,.12),0 8px 32px rgba(0,0,0,.13); }
  .portal-face::after { border-radius:inherit;background:radial-gradient(ellipse at var(--portal-light-x,50%) -12%,rgba(238,248,255,.22),transparent 58%),linear-gradient(118deg,rgba(233,244,255,.10),transparent 27%,transparent 76%,rgba(220,232,242,.06)); }
  .portal-face-header { padding-left:20px; }
  .portal-face-header h2 { font-size:20px;font-weight:560;letter-spacing:-.02em; }
  .portal-navigation { right:10px;top:11px;gap:1px; }
  .portal-nav-button { width:34px;height:34px;color:#d7dfe5;border-radius:50%; }
  .portal-body { padding:0 20px; }
  .portal-tabs { margin-bottom:5px;padding:3px;border-radius:24px;background:rgba(1,7,15,.22);gap:2px; }
  .portal-tabs button { height:33px;font-size:14px;border-radius:20px;color:#b1bdc7; }
  .portal-tabs button[aria-selected="true"] { background:rgba(225,237,247,.16);box-shadow:inset 0 1px rgba(255,255,255,.16),0 2px 4px #0002;color:#f5f6f5; }
  .portal-match-row,.portal-history-row { min-height:70px;gap:12px;padding:7px 0;border-bottom-color:rgba(239,247,254,.075); }
  .portal-history-item:last-child .portal-history-row { border-bottom:0; }
  .portal-teams { font-size:16px;font-weight:450;line-height:1.4; }
  .portal-teams>small,.portal-match-time small { font-size:13px;color:#aab8c5;line-height:1.45; }
  .portal-match-time strong { font-size:18px;font-weight:500; }
  .portal-score { font-size:26px;font-weight:450;letter-spacing:-.04em; }
  .portal-history-row { position:relative;border-radius:7px;padding:3px 0;transition:background 160ms var(--ui-ease-out); }
  .portal-history-row .portal-teams { line-height:1.35; }
  .portal-history-row[aria-expanded="true"] { background:rgba(231,242,253,.07); }
  .portal-face-footer { padding:0 20px; }
  .portal-all-link { font-size:14px;color:#d1dbe2; }
  .portal-dot { width:22px; }
  .portal-dot span { width:5px;height:5px;background:#82909d; }
  .portal-dot[aria-current="true"] span { background:#e1d6bd; }
  .portal-empty { font-size:14px; }
  .portal-account { padding-top:8px; }
  .portal-account-identity strong { font-size:21px;font-weight:450; }
  .portal-account-balance { padding:18px 0;font-size:15px; }
  .portal-account-balance strong { font-size:28px; }
  .portal-login { height:40px;justify-content:center;font-size:15px;border-radius:22px;background:rgba(216,231,243,.12);border-color:rgba(227,239,248,.18); }
  .portal-account-notice { font-size:13px;margin-top:12px; }
  .portal-history-popover { width:350px;padding:22px;border:1px solid rgba(226,242,255,.18);border-radius:22px;background:linear-gradient(135deg,rgba(53,67,80,.57),rgba(18,28,40,.74));backdrop-filter:blur(24px) saturate(1.2);-webkit-backdrop-filter:blur(24px) saturate(1.2);box-shadow:inset 0 1px rgba(255,255,255,.14),0 18px 44px #0004; }
  .portal-preview-header { padding-bottom:16px; }
  .portal-preview-header p { font-size:14px; }
  .portal-preview-header h3 { font-size:18px;line-height:1.5;font-weight:500; }
  .portal-history-detail dt { font-size:14px; }
  .portal-history-popover .portal-history-detail dd { font-size:16px; }
  .portal-history-popover .portal-history-detail .portal-probability { font-size:28px;font-weight:450;letter-spacing:-.03em; }
  .portal-history-popover .portal-saved-at dd { font-size:14px; }
  .portal-history-popover footer { justify-content:flex-end;font-size:14px; }
  .portal-preview-header button { font-size:24px; }
}
@media (prefers-reduced-transparency:reduce) {
  .portal-face,.portal-history-popover { background:#17232e;backdrop-filter:none;-webkit-backdrop-filter:none; }
}
