﻿:root{
  --bg:#040607;
  --panel:#0a0f14;
  --panel2:#0d131a;
  --text:#e7fff1;
  --muted:#7d8a92;
  --line:#111821;
  --accent:#5efc7c;
  --accent-2:#2bd3a5;
  --accent-soft:rgba(94,252,124,.14);
  --danger:#ff5c7a;
  --good:#4df78c;
  --warn:#f5c542;
  --gold:#ffd700;
  --silver:#c0c0c0;
  --bronze:#cd7f32;
  --shadow: 0 18px 40px rgba(0,0,0,.55), 0 0 24px rgba(94,252,124,.12);
  --radius: 16px;
  --radius2: 12px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: "Segoe UI", "Helvetica Neue", Arial, system-ui, -apple-system, "Apple Color Emoji","Segoe UI Emoji";
}

*{ box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin:0;
  background:
    radial-gradient(1400px 900px at 12% 8%, rgba(94,252,124,.20), transparent 55%),
    radial-gradient(1200px 800px at 82% 6%, rgba(51,164,255,.12), transparent 60%),
    linear-gradient(135deg, #05080c 0%, #030405 60%, #020304 100%);
  color:var(--text);
  font-family: var(--sans);
  overflow: auto;
  color-scheme: dark;
  position: relative;
}
body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 120px 120px;
  mask-image: radial-gradient(circle at 50% 20%, rgba(255,255,255,.35), transparent 55%);
  opacity: .4;
  z-index: -1;
}
body::after{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(900px 700px at 50% -10%, rgba(94,252,124,.10), transparent 60%);
  z-index:-1;
}
html, body, .rankList, .embedRow{
  scrollbar-color: var(--line) rgba(255,255,255,.03);
  scrollbar-width: thin;
}
/* dark scrollbars */
::-webkit-scrollbar{
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track{
  background: rgba(255,255,255,.03);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.16);
  border-radius: 10px;
  border: 2px solid rgba(0,0,0,.25);
}
::-webkit-scrollbar-thumb:hover{
  background: rgba(255,255,255,.24);
}

.app{
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display:flex;
  flex-direction:column;
  gap: 12px;
}

.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding: 16px 18px;
  background: linear-gradient(140deg, rgba(12,18,24,.92), rgba(10,15,22,.78) 70%, rgba(94,252,124,.08));
  border: 1px solid rgba(94,252,124,.22);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.brand{ display:flex; gap:12px; align-items:center; }
.logo{
  width: 40px; height: 40px;
  border-radius: 12px;
  display:flex; align-items:center; justify-content:center;
  background: rgba(94,252,124,.16);
  border: 1px solid rgba(94,252,124,.35);
  font-weight: 800;
  letter-spacing: .5px;
}
.titles .title{
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 0 12px rgba(94,252,124,.25);
}
.titles .subtitle{ font-size: 12px; color: var(--muted); margin-top: 2px; letter-spacing: 0.03em; }

.controls{ display:flex; gap:10px; align-items:center; }
.urlActions{
  display:flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.urlActionRow{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.urlActionRow .loadGroup{
  margin-left: auto;
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
}
.topActionRow{
  margin: 4px 0 8px;
  justify-content: flex-end;
}
.inputTabs{
  display:flex;
  gap: 8px;
  margin: 6px 0 10px;
}
.inputTab{
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  cursor:pointer;
  font-size: 12px;
  transition: background .15s ease, border-color .15s ease, transform .12s ease;
}
.inputTab.active{
  background: linear-gradient(120deg, rgba(94,252,124,.26), rgba(43,211,165,.30));
  border-color: rgba(94,252,124,.55);
  color: #0b0f14;
  box-shadow: 0 8px 24px rgba(94,252,124,.22);
}
.inputTab:hover{ transform: translateY(-1px); background: rgba(255,255,255,.08); }
.inputModeWrap{ width: 100%; }
.inputMode{ display:none; }
.inputMode.active{ display:block; }
.subHint{ margin-bottom: 6px; }
.individualList{
  display:flex;
  flex-direction: column;
  gap: 8px;
  max-height: 460px;
  overflow-y: auto;
  padding: 2px 0;
}
.individualHeader{
  display:grid;
  grid-template-columns: 30px 1.1fr 0.9fr 54px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  padding: 4px 10px 4px 10px;
}
.individualHeader .center{
  text-align: center;
}
.individualRow{
  display:grid;
  grid-template-columns: 30px 1.1fr 0.9fr 54px;
  gap: 8px;
  align-items: center;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(94,252,124,.10);
  border-radius: 12px;
  padding: 8px 10px;
}
.rowIndex{
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.textInput{
  width: 100%;
  background: rgba(0,0,0,.26);
  border: 1px solid rgba(94,252,124,.18);
  color: var(--text);
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 12.5px;
  font-family: var(--sans);
}
.textInput:focus{
  outline: none;
  border-color: rgba(94,252,124,.45);
  box-shadow: 0 0 0 3px rgba(94,252,124,.16);
}
.textInput::placeholder{ color: rgba(255,255,255,.28); }
.btn.iconOnly{
  width: 34px;
  padding: 8px;
  text-align: center;
}
.individualActionRow{
  justify-content: flex-end;
  align-items: center;
}
.btnAddRow{
  display: none;
}
.app.inputIndividual #btnAddRow{
  display: inline-flex;
}
.clock{
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  border-radius: 12px;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--muted);
}
.goalLabel{
  display:flex;
  flex-direction:column;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  margin-left: 150px;
  margin-right: 20px
}
.goalInput{
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(94,252,124,.25);
  color: var(--text);
  color-scheme: dark;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 13px;
  min-width: 120px;
}
.goalInput:focus{
  outline: none;
  border-color: rgba(94,252,124,.55);
  box-shadow: 0 0 0 3px rgba(94,252,124,.16);
}
.btn{
  border: 1px solid rgba(94,252,124,.25);
  background: rgba(255,255,255,.04);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 12px;
  cursor:pointer;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, opacity .15s ease;
  user-select:none;
  font-size: 12px;
}
.btn:hover:not(:disabled){ transform: translateY(-1px); background: rgba(255,255,255,.07); border-color: rgba(94,252,124,.28); }
.btn:active:not(:disabled){ transform: translateY(0); opacity: .92; }
.btn:disabled{ opacity: .5; cursor: not-allowed; }
.btn.primary{
  background: linear-gradient(120deg, rgba(94,252,124,.24), rgba(43,211,165,.32));
  border-color: rgba(94,252,124,.65);
  box-shadow: 0 6px 24px rgba(94,252,124,.25);
}
.btn.primary:hover:not(:disabled){ background: linear-gradient(120deg, rgba(94,252,124,.32), rgba(43,211,165,.38)); }
.btn.danger{ background: rgba(255,77,109,.16); border-color: rgba(255,77,109,.32); }
.btn.danger:hover:not(:disabled){ background: rgba(255,77,109,.22); }

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: 14px;
  flex: 1;
  min-height: 0;
}
.app.connected .grid{
  grid-template-columns: 1fr;
}

.panel{
  background: linear-gradient(180deg, rgba(11,16,23,.92), rgba(7,11,15,.82));
  border: 1px solid rgba(94,252,124,.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  display:flex;
  flex-direction:column;
  min-height: 0;
}

.panelHead{ margin-bottom: 10px; position: relative; }
.panelTitleRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}
.panelTitleGroup{
  display:flex;
  align-items:center;
  gap: 12px;
  flex-wrap: wrap;
}
.searchBox{
  display:flex;
  align-items:center;
  gap: 8px;
}
.searchBox .searchInput{
  min-width: 220px;
  border: 1px solid rgba(94,252,124,.25);
}
.embedPanel .panelTitleRow{
  justify-content: flex-start;
}
.panelMeta{
  display:grid;
  flex: 1;
  min-width: 0;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  justify-items: start;
  gap: 10px 14px;
  color: #dfffea;
  font-size: 20px;
}
.panelMeta .metaBlock{
  display:flex;
  flex-direction: column;
  gap: 4px;
}
.panelMeta .metaBlock-current{
  text-align: center;
}
.panelMeta .metaBlock-goal{
  text-align: center;
  justify-self: center;
}
.panelMeta .metaBlock-remain{
  text-align: center;
  justify-self: end;
}
.panelMeta .metaLabel{
  color: rgba(255,255,255,.65);
  font-size: 11px;
  letter-spacing: 0.03em;
}
.panelMeta .metaDivider{
  color: rgba(255,255,255,.35);
  font-size: 12px;
}
.panelMeta .metaValue{
  font-family: var(--mono);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(94,252,124,.10);
  color: #c8ffd6;
  box-shadow:
    inset 0 0 0 1px rgba(94,252,124,.32),
    0 0 14px rgba(94,252,124,.22);
  text-shadow:
    0 0 6px rgba(94,252,124,.45),
    0 0 16px rgba(94,252,124,.28);
}
.panelMeta .metaClock{
  min-width: 138px;
}
.panelMeta .metaRemain{
  color: var(--danger);
  background: rgba(255,77,109,.12);
  box-shadow:
    inset 0 0 0 1px rgba(255,77,109,.32),
    0 0 16px rgba(255,77,109,.28);
  text-shadow:
    0 0 8px rgba(255,77,109,.55),
    0 0 18px rgba(255,77,109,.30);
}
.panelActions{ display:flex; align-items:center; gap: 8px; }
.panelTitle{ font-weight: 800; font-size: 14px; letter-spacing: 0.02em; }
.panelHint{ color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.35; }
.sortBar{
  display:flex;
  justify-content:flex-end;
  margin-top: 10px;
}
.embedActions{
  display:flex;
  align-items:center;
  gap: 8px;
}
.embedPanel #btnSlideToggle,
.embedPanel #btnEmbedVisibility{
  margin: 0;
  text-align: left;
}

.app.connected .urlPanel{
  display: none;
}
.app.connected .rankPanel{
  grid-column: 1 / -1;
}

.textarea{
  width: 100%;
  min-height: 180px;
  height: 450px;
  resize: vertical;
  border-radius: var(--radius2);
  border: 1px solid rgba(94,252,124,.18);
  background: rgba(0,0,0,.26);
  color: var(--text);
  padding: 12px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.5;
  outline: none;
}
.textarea:focus{
  border-color: rgba(94,252,124,.45);
  box-shadow: 0 0 0 3px rgba(94,252,124,.16);
}

.statusBar{
  width: 100%;
}
.statusRow{
  margin-top: 5px;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap: 10px;
}
.statusMsg{
  font-size: 12px;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(94,252,124,.12);
  background: linear-gradient(120deg, rgba(20, 20, 20, 0.701), rgba(255, 255, 255, 0.077));
  flex: 1;
  margin-bottom: 10px;
}
.statusBar .statusMsg{
  margin-bottom: 0;
}
.statusMsg .statusLabel{
  font-weight: 700;
}
.statusMsg .statusLabel.running{
  color: #7bf29f;
}
.statusMsg .statusLabel.waiting{
  color: #f4d35e;
}
.statusMsg .statusLabel.disconnected{
  color: #ff6b6b;
}
.statusMsg .statusLabel.ended{
  color: #f4d35e;
}

.app.connected #rankPanelTitle{
  display: none;
}

.sortBox{ display:flex; align-items:center; gap: 8px; }
.sortLabel{ color: var(--muted); font-size: 12px; }
.pill{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 999px;
  cursor:pointer;
  transition: background .15s ease, border-color .15s ease;
  font-size: 12px;
  white-space: nowrap;
}
.pill.active{
  background: linear-gradient(120deg, rgba(94,252,124,.35), rgba(43,211,165,.35));
  border-color: rgba(94,252,124,.65);
  color: #0b0f14;
  box-shadow: 0 8px 18px rgba(94,252,124,.25);
}

.tableWrap{
  border-radius: var(--radius2);
  border: 1px solid rgba(94,252,124,.10);
  overflow: hidden;
  background: rgba(7, 11, 15, 0.52);
  display:flex;
  flex-direction:column;
  flex: 0 0 auto;
  height: var(--rank-height, 520px);
  min-height: 260px;
  max-height: 80vh;
  resize: vertical;
}

.tableHeader{
  display:grid;
  grid-template-columns: 72px 1.8fr 1fr 70px 1fr 70px 1fr 120px;
  column-gap: 10px;
  padding: 10px 10px;
  background: linear-gradient(90deg, rgba(94,252,124,.14), rgba(94,252,124,.06));
  color: #d6ffe7;
  font-size: 12px;
  border-bottom: 1px solid rgba(94,252,124,.22);
}
.tableHeader > div:first-child{ text-align: center; }
.tableHeader > div:last-child{ text-align: right; }
.tableHeader .trendHead{ text-align: center; }

.raceWrap{
  display: none;
  position: relative;
  height: var(--race-height, 350px);
  min-height: 180px;
  max-height: 70vh;
  background: linear-gradient(180deg, rgb(6, 10, 13), rgb(9, 14, 19));
  border-bottom: 1px solid rgba(94,252,124,.18);
  resize: vertical;
  overflow: auto;
  margin-bottom: 10px;
}
.raceWrap.active{
  display: block;
}
.raceCanvas{
  width: 100%;
  height: 100%;
  display: block;
}

.rankList{
  position: relative;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.row{
  display:grid;
  grid-template-columns: 72px 1.8fr 1fr 70px 1fr 70px 1fr 120px;
  column-gap: 10px;
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  align-items:center;
  transform: translateY(0);
  transition: transform 260ms cubic-bezier(.2,.9,.2,1), background 120ms ease;
  will-change: transform;
}
.row-swapped{
  animation:
    swapFlash 900ms ease,
    swapLift 650ms cubic-bezier(.16,.78,.43,1);
  background: linear-gradient(90deg, rgba(94,252,124,.16), transparent);
  box-shadow: 0 12px 30px rgba(94,252,124,.22), 0 0 0 1px rgba(94,252,124,.18);
}
/* Rank movement highlight */
.row-up{
  animation: none;
  background: transparent;
  box-shadow: none;
}
.row-down{
  animation: none;
  background: transparent;
  box-shadow: none;
}
@keyframes swapFlash{
  0% { background: linear-gradient(110deg, rgba(94,252,124,.32), transparent); box-shadow: 0 18px 40px rgba(94,252,124,.34), 0 0 0 2px rgba(94,252,124,.30); }
  50% { background: linear-gradient(110deg, rgba(94,252,124,.24), transparent 60%); box-shadow: 0 14px 32px rgba(94,252,124,.24), 0 0 0 1px rgba(94,252,124,.20); }
  100% { background: linear-gradient(90deg, rgba(94,252,124,.00), transparent); box-shadow: 0 0 0 rgba(0,0,0,0); }
}
@keyframes swapLift{
  0% { transform: translateY(-2px) scale(1.005); }
  50% { transform: translateY(-4px) scale(1.01); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes rankUp{
  0% { transform: translateY(-3px); }
  40% { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}
@keyframes rankDown{
  0% { transform: translateY(3px); }
  40% { transform: translateY(6px); }
  100% { transform: translateY(0); }
}
.row:hover{ background: rgba(94,252,124,.05); }
.row:last-child{ border-bottom: 0; }
.tableWrap.listMode .tableHeader,
.tableWrap.listMode .row{
  grid-template-columns: 52px 1.8fr 120px 80px;
}
.tableWrap.listMode .rankCell{
  justify-content: center;
}
.listAdd{
  display:flex;
  justify-content:center;
}
.listAdd .btn{
  padding: 6px 8px;
  font-size: 11px;
}

/* 荳贋ｽ・菴阪・繝上う繝ｩ繧､繝・*/
.row.rank-1 { background: linear-gradient(90deg, rgba(94,252,124,.20), transparent); border-left: 3px solid var(--gold); }
.row.rank-2 { background: linear-gradient(90deg, rgba(192,192,192,.12), transparent); border-left: 3px solid var(--silver); }
.row.rank-3 { background: linear-gradient(90deg, rgba(205,127,50,.12), transparent); border-left: 3px solid var(--bronze); }

.row.rank-1 .rank { color: var(--gold); font-weight: 800; font-size: 16px; }
.row.rank-2 .rank { color: var(--silver); font-weight: 700; font-size: 15px; }
.row.rank-3 .rank { color: var(--bronze); font-weight: 600; font-size: 14px; }

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
}
.badge.live{ border-color: rgba(94,252,124,.45); background: rgba(94,252,124,.12); color: #ffffff; font-weight: 700; letter-spacing: 0.02em; }
.badge.off{ border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.06); color: rgba(255,255,255,.7); }
.badge.tc{ border-color: rgba(91,157,255,.30); background: rgba(91,157,255,.10); }
.badge.kick{ border-color: rgba(94,252,124,.45); background: rgba(94,252,124,.12); color: #0b0f14; font-weight: 700; letter-spacing: 0.02em; }
.badge.unknown{ border-color: rgba(255,77,109,.30); background: rgba(255,77,109,.10); }
.badge.tc:empty{
  padding: 5px 8px;
  min-width: 10px;
}

.muted{ color: var(--muted); font-size: 12px; }
.idline{ font-family: var(--mono); font-size: 11.5px; color: rgba(233,238,245,.78); word-break: break-all; }
.titleline{ font-size: 13px; font-weight: 650; margin-bottom: 2px; }

.streamInfo{
  display:flex;
  align-items:flex-start;
  gap: 10px;
  min-width: 0;
}
.streamTexts{
  display:flex;
  flex-direction:column;
  gap: 2px;
  min-width: 0;
}
.nameBadge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 26px;
  height: 26px;
  margin-right: 8px;
  border-radius: 6px;
  background: var(--badge-bg, rgba(94,252,124,.12));
  border: 2px solid var(--badge-border, rgba(94,252,124,.35));
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
  color: #ffffff;
  flex-shrink: 0;
}
.badgeColor-1 { --badge-border: #ffffff; --badge-bg: rgba(255, 255, 255, 0.18); --badge-fg: #0b0f14; }
.badgeColor-2 { --badge-border: #111111; --badge-bg: rgba(17, 17, 17, 0.18); --badge-fg: #ffffff; }
.badgeColor-3 { --badge-border: #e33d3d; --badge-bg: rgba(227, 61, 61, 0.18); --badge-fg: #ffffff; }
.badgeColor-4 { --badge-border: #0015f8; --badge-bg: rgba(0, 21, 248, 0.18); --badge-fg: #ffffff; }
.badgeColor-5 { --badge-border: #f0d44b; --badge-bg: rgba(240, 212, 75, 0.18); --badge-fg: #0b0f14; }
.badgeColor-6 { --badge-border: #00ff26; --badge-bg: rgba(0, 255, 38, 0.18); --badge-fg: #0b0f14; }
.badgeColor-7 { --badge-border: #ff9d3a; --badge-bg: rgba(255, 157, 58, 0.18); --badge-fg: #0b0f14; }
.badgeColor-8 { --badge-border: #ff78b7; --badge-bg: rgba(255, 120, 183, 0.18); --badge-fg: #0b0f14; }
.badgeColor-9 { --badge-border: #7c4dff; --badge-bg: rgba(124, 77, 255, 0.18); --badge-fg: #ffffff; }
.badgeColor-10 { --badge-border: #4aa3ff; --badge-bg: rgba(74, 163, 255, 0.18); --badge-fg: #0b0f14; }
.badgeColor-11 { --badge-border: #ffd166; --badge-bg: rgba(255, 209, 102, 0.18); --badge-fg: #0b0f14; }
.badgeColor-12 { --badge-border: #6b7280; --badge-bg: rgba(107, 114, 128, 0.18); --badge-fg: #ffffff; }
.badgeColor-13 { --badge-border: #22c55e; --badge-bg: rgba(34, 197, 94, 0.18); --badge-fg: #0b0f14; }
.badgeColor-14 { --badge-border: #ff4d6d; --badge-bg: rgba(255, 77, 109, 0.18); --badge-fg: #0b0f14; }
.badgeColor-15 { --badge-border: #a855f7; --badge-bg: rgba(168, 85, 247, 0.18); --badge-fg: #ffffff; }
.badgeColor-16 { --badge-border: #14b8a6; --badge-bg: rgba(20, 184, 166, 0.18); --badge-fg: #0b0f14; }
.badgeColor-17 { --badge-border: #f97316; --badge-bg: rgba(249, 115, 22, 0.18); --badge-fg: #0b0f14; }
.badgeColor-18 { --badge-border: #94a3b8; --badge-bg: rgba(148, 163, 184, 0.18); --badge-fg: #0b0f14; }
.badgeColor-19 { --badge-border: #0ea5e9; --badge-bg: rgba(14, 165, 233, 0.18); --badge-fg: #0b0f14; }
.badgeColor-20 { --badge-border: #84cc16; --badge-bg: rgba(132, 204, 22, 0.18); --badge-fg: #0b0f14; }

.num{ text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.rankCell{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 6px;
}
.rankTrend{
  display:inline-block;
  width: 14px;
  text-align:center;
  font-size: 12px;
  opacity: .9;
}
.rankTrend.up{ color: #5fd38d; animation: trendFade 1s ease forwards; }
.rankTrend.down{ color: #ff6b81; animation: trendFade 1s ease forwards; }
.num.rank{ text-align: center; }
.timeCol{ text-align: right; white-space: nowrap; }
.metric{ position: relative; }
.trendCell{
  text-align: center;
  min-width: 0;
}
.trend{
  display: inline-block;
  font-size: 11px;
  margin-left: 6px;
  vertical-align: middle;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  animation: trendFade 2s ease forwards;
}
.trend.up{
  color: #5fd38d;
  background: rgba(95,211,141,.12);
  border-color: rgba(95,211,141,.28);
}
.trend.down{
  color: #ff6b81;
  background: rgba(255,107,129,.12);
  border-color: rgba(255,107,129,.28);
}
@keyframes trendBlink{
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0.35; transform: translateY(-1px); }
}
@keyframes trendFade{
  0% { opacity: 1; transform: translateY(0); }
  70% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-2px); }
}
.status{
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  width: fit-content;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  cursor: help;
}
.status.ok{ border-color: rgba(51,209,122,.25); background: rgba(51,209,122,.10); }
.status.err{ border-color: rgba(255,77,109,.25); background: rgba(255,77,109,.10); }
.status.stop{ border-color: rgba(154,167,181,.25); background: rgba(154,167,181,.10); }

.footer{
  display:flex;
  justify-content:space-between;
  padding: 10px 4px;
  color: var(--muted);
  border-top: 1px solid rgba(94,252,124,.12);
  margin-top: 4px;
}

.embedRow{
  display:flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
}
.embedContent{
  overflow: hidden;
  padding-top: 4px;
}
.embedContent.collapsed{
  display: none;
  max-height: 0;
  min-height: 0;
  height: 0;
  padding-top: 0;
}

.embedCard{
  border: 1px solid rgba(94,252,124,.14);
  border-radius: var(--radius2);
  background: linear-gradient(180deg, rgba(10,15,20,.94), rgba(7,10,14,.86));
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0,0,0,.40), 0 0 22px rgba(94,252,124,.14);
  transition: transform 200ms ease, box-shadow 200ms ease;
  flex: 0 0 340px;
}
.embedCard:hover{
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0,0,0,.55), 0 0 30px rgba(94,252,124,.18);
}

/* 荳贋ｽ・菴阪・繧ｫ繝ｼ繝芽｣・｣ｾ */
.embedCard.rank-1 { border: 2px solid var(--gold); box-shadow: 0 0 30px rgba(255,215,0,.25); }
.embedCard.rank-2 { border: 2px solid var(--silver); box-shadow: 0 0 25px rgba(192,192,192,.20); }
.embedCard.rank-3 { border: 2px solid var(--bronze); box-shadow: 0 0 20px rgba(205,127,50,.18); }

.embedPlayer{
  position: relative;
  background: #000;
  padding-top: 56.25%;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.embedPlayer iframe{
  position:absolute;
  top:0; left:0;
  width:100%;
  height:100%;
  border:0;
}
.embedThumb{
  position: relative;
  background: radial-gradient(500px 300px at 20% 20%, rgba(94,252,124,.22), transparent 60%), rgba(0,0,0,.26);
  height: 140px;
  display:flex;
  align-items:center;
  justify-content:center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .3px;
  border-bottom: 1px solid rgba(94,252,124,.12);
}
.thumbBadge{
  position:absolute;
  top: 10px;
  left: 10px;
}
.thumbLabel{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(94,252,124,.20);
  border-radius: 10px;
  backdrop-filter: blur(5px);
}
.thumbRank{
  font-weight: 800;
  font-size: 24px;
  line-height: 1;
}
.thumbViewers{
  font-size: 13px;
  opacity: .9;
}

.embedCard.rank-1 .thumbRank { color: var(--gold); }
.embedCard.rank-2 .thumbRank { color: var(--silver); }
.embedCard.rank-3 .thumbRank { color: var(--bronze); }

.embedBody{
  padding: 12px;
  display:flex;
  flex-direction:column;
  gap: 8px;
}
.embedTitle{
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1.3;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.embedId{
  font-family: var(--mono);
  color: rgba(233,238,245,.78);
  font-size: 11.5px;
  word-break: break-all;
  display: -webkit-box;
  line-clamp: 1;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.embedStats{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.embedStats div{
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(94,252,124,.10);
  border-radius: 10px;
  padding: 8px;
  display:flex;
  flex-direction:column;
  gap: 4px;
}
.statLabel{
  color: var(--muted);
  font-size: 11px;
}
.statValue{
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
}
.embedFooter{
  display:flex;
  align-items:center;
  justify-content:space-between;
}

@media (max-width: 1020px){
  .grid{ grid-template-columns: 1fr; }
  .textarea{ max-height: 260px; }
  .tableHeader, .row{
    grid-template-columns: 60px 1.5fr 1fr 60px 1fr 60px 1fr 110px;
    column-gap: 8px;
  }
  .embedRow{ flex-wrap: wrap; overflow-x: visible; }
}

@media (max-width: 640px){
  .topbar{
    flex-direction: column;
    gap: 12px;
  }
  .controls{
    width: 100%;
    justify-content: stretch;
    flex-wrap: wrap;
    gap: 8px;
  }
  .btn{
    flex: 1;
    font-size: 13px;
    padding: 8px;
  }
  .raceWrap{
    height: 200px;
  }
  .sortBox{
    flex-wrap: wrap;
  }
  .panelTitleRow{
    align-items:flex-start;
  }
  .panelTitleGroup{
    width: 100%;
  }
  .searchBox{
    width: 100%;
  }
  .searchBox .searchInput{
    min-width: 0;
    flex: 1;
  }
}

@media (max-width: 375px){
  .app{
    padding: 12px;
  }
  .topbar{
    padding: 12px;
  }
  .logo{
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }
  .titles .title{
    font-size: 15px;
  }
  .titles .subtitle{
    font-size: 11px;
  }
  .panel{
    padding: 12px;
  }
  .controls{
    gap: 6px;
  }
  .controls .btn{
    font-size: 12px;
    padding: 7px;
  }
  .urlActionRow{
    gap: 6px;
  }
  .individualHeader{
    font-size: 11px;
  }
  .individualRow{
    grid-template-columns: 26px 1.2fr 0.8fr 38px;
    gap: 6px;
    padding: 6px 8px;
  }
  .btn.iconOnly{
    width: 30px;
    padding: 6px;
  }
  .panelTitleRow{
    flex-direction: column;
    align-items: stretch;
  }
  .panelTitleGroup{
    width: 100%;
  }
  .searchBox{
    width: 100%;
  }
  .tableWrap{
    height: 420px;
    max-height: 70vh;
    resize: none;
    overflow-x: auto;
  }
  .tableHeader, .rankList .row{
    min-width: 720px;
  }
  .tableWrap.listMode .tableHeader,
  .tableWrap.listMode .row{
    min-width: 520px;
  }
}




