/* Roll-A-Dew instrument — CRT preview + rolodex drum + Dewey cabinet + pneumatic tube. */
.rad-hud {
  --brass: #c4a056;
  --brass-dim: #8a6a32;
  --wood: #2a1a0c;
  --wood-lit: #3d2814;
  --plate: #12100c;
  --crt: #031408;
}

.rad-atmosphere {
  background:
    radial-gradient(ellipse at 70% 40%, #0a2214 0%, transparent 55%),
    radial-gradient(ellipse at 20% 80%, #1a1208 0%, transparent 50%),
    repeating-linear-gradient(90deg, #050805 0 48px, #080a08 48px 49px),
    repeating-linear-gradient(0deg, #050805 0 48px, #080a08 48px 49px),
    #030403;
  filter: none;
  opacity: 1;
}
.rad-atmosphere::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, #000 100%);
  pointer-events: none;
}

.rad-rack {
  position: relative; z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  margin: 10px 16px 0;
  padding: 8px 12px 8px 16px;
  background: linear-gradient(#2a2a2a, #141414 40%, #0c0c0c);
  border: 2px solid #3a3a3a;
  box-shadow: 0 8px 0 #000, inset 0 1px 0 #555;
}
.rad-rack__brand {
  font-weight: 700; letter-spacing: 4px; font-size: 1.15rem;
  text-shadow: 0 0 12px var(--g);
}
.rad-rack__brand small {
  display: block; letter-spacing: 1px; font-size: .68rem; opacity: .7; font-weight: 400;
}
.rad-leds { display: flex; gap: 14px; font-size: .68rem; letter-spacing: 1px; }
.rad-led { display: flex; align-items: center; gap: 6px; opacity: .8; }
.rad-led i {
  width: 10px; height: 10px; border-radius: 50%;
  background: #330; box-shadow: inset 0 0 4px #000;
}
.rad-led.is-on i {
  background: var(--g);
  box-shadow: 0 0 10px var(--g), 0 0 2px #fff;
}
.rad-led.is-warn i { background: #ff3344; box-shadow: 0 0 10px #ff3344; }
.rad-close {
  position: static; width: 34px; height: 34px;
  box-shadow: 0 3px 0 #400;
}

.rad-world { height: calc(100% - 122px); padding: 10px 16px 18px; }
.rad-stage {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(320px, 1fr);
  gap: 14px;
  height: 100%;
  min-height: 0;
}

.rad-crt {
  display: flex; flex-direction: column; min-height: 0;
  background: linear-gradient(#1c1c1c, #0a0a0a);
  border: 3px solid #2a2a2a;
  border-radius: 18px 18px 12px 12px;
  box-shadow:
    0 18px 40px #000,
    inset 0 0 0 6px #111,
    inset 0 0 0 10px #333;
  padding: 14px 14px 16px;
}
.rad-crt__top {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0 8px 8px;
  color: #888;
  font-size: .68rem;
  letter-spacing: 2px;
}
.rad-crt__glass {
  flex: 1; min-height: 0; overflow: auto;
  background:
    linear-gradient(rgba(0, 255, 102, .04), transparent 30%),
    var(--crt);
  border: 3px solid #0a0a0a;
  border-radius: 4px;
  box-shadow:
    inset 0 0 40px #00ff6614,
    inset 0 0 80px #000,
    0 0 24px #00ff6622;
  padding: 14px 14px 18px;
  position: relative;
}
.rad-crt__glass::after {
  content: "";
  pointer-events: none;
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(transparent 0 2px, rgba(0,0,0,.18) 2px 3px),
    radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,.45) 100%);
}
.rad-shell[data-view="idle"] .rad-term::after {
  content: "█";
  animation: rad-blink 1.1s steps(1) infinite;
}
@keyframes rad-blink { 50% { opacity: 0; } }

.rad-deck {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  min-height: 0;
}

.rad-rolo {
  grid-column: 1;
  background:
    linear-gradient(#3a2a18, var(--wood));
  border: 3px solid var(--brass-dim);
  box-shadow: 0 10px 0 #100804, inset 0 1px 0 #6a5030;
  padding: 8px 10px 12px;
  position: relative;
}
.rad-rolo__plate {
  width: 100%;
  background: var(--plate);
  color: var(--brass);
  border: 1px solid var(--brass-dim);
  letter-spacing: 3px;
  font-weight: 700;
  padding: 6px 8px;
  cursor: pointer;
  margin-bottom: 8px;
}
.rad-rolo__plate small {
  display: block; letter-spacing: 1px; font-size: .62rem; opacity: .7; font-weight: 400;
}
.rad-rolo__drum {
  height: 132px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0;
  overflow-x: auto;
  padding: 4px 8px 6px;
}
.rad-tab {
  flex: 0 0 72px;
  width: 72px; height: 118px;
  margin-left: -12px;
  background: linear-gradient(#f3e2b8, #d4b878 70%, #b89450);
  color: #1a1008;
  border: 1px solid #8a6a32;
  border-bottom: 4px solid #6a4a20;
  font-size: .58rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 2px 4px 0 #0006;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 6px 4px;
  z-index: 1;
}
.rad-tab:first-child { margin-left: 0; }
.rad-tab .chrf-fig { transform: scale(.85); }
.rad-tab em {
  font-style: normal;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rad-tab:hover, .rad-tab.is-front {
  background: linear-gradient(#fff6d0, #e8c86a);
  transform: translateY(-10px);
  z-index: 20;
  margin-left: 0;
}
.rad-tab--empty {
  writing-mode: horizontal-tb;
  width: auto; height: auto; padding: 8px 12px;
  background: transparent; color: var(--brass); border: 1px dashed var(--brass-dim);
  box-shadow: none; transform: none;
}

.rad-cab {
  min-height: 0; overflow: auto;
  background:
    repeating-linear-gradient(90deg, #24160c 0 3px, #2e1c10 3px 6px),
    var(--wood);
  border: 4px solid #4a3218;
  box-shadow:
    0 16px 0 #100804,
    inset 0 0 30px #0008;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rad-cab__lid {
  background: linear-gradient(#4a3418, #2a1c0c);
  color: var(--brass);
  border: 2px solid var(--brass-dim);
  letter-spacing: 2px;
  font-weight: 700;
  padding: 8px;
  margin: 0;
  text-align: center;
  text-shadow: 0 1px 0 #000;
}
.rad-banks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  flex: 1;
  min-height: 0;
}
.rad-bank h4 {
  margin: 0 0 6px;
  text-align: center;
  font-size: .62rem;
  letter-spacing: 1px;
  color: var(--brass);
  border-bottom: 1px solid #5a4020;
  padding-bottom: 4px;
}
.rad-draw {
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: auto auto;
  gap: 0 6px;
  width: 100%;
  margin-bottom: 6px;
  padding: 7px 6px 8px;
  background: linear-gradient(#3a2814, #22160c);
  color: #e8d2a0;
  border: 1px solid #5a4028;
  border-bottom-width: 3px;
  cursor: pointer;
  text-align: left;
  position: relative;
  box-shadow: inset 0 1px 0 #6a5030;
}
.rad-draw b {
  grid-row: 1 / span 2;
  font-size: 1.05rem;
  color: var(--g);
  text-shadow: 0 0 8px #00ff6644;
  line-height: 1;
  align-self: center;
}
.rad-draw span {
  font-size: .58rem;
  letter-spacing: .3px;
  opacity: .9;
  grid-column: 2;
}
.rad-draw__pull {
  grid-column: 2;
  width: 22px; height: 6px;
  margin-top: 3px;
  border-radius: 6px;
  background: radial-gradient(circle at 30% 40%, #e8c878, var(--brass-dim));
  box-shadow: 0 1px 0 #000;
}
.rad-draw:hover {
  transform: translateX(3px);
  border-color: var(--brass);
}
.rad-draw.is-open {
  transform: translateX(10px);
  background: linear-gradient(#4a3820, #2a1c10);
  border-color: var(--g);
  box-shadow: 0 0 16px #00ff6633, inset 0 0 12px #00ff6614;
}

.rad-tube {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  background: linear-gradient(90deg, #222, #111 40%, #1a1a1a);
  border: 2px solid #444;
  cursor: pointer;
  color: var(--g);
  letter-spacing: 2px;
  font-size: .62rem;
  font-weight: 700;
  writing-mode: vertical-rl;
}
.rad-tube__pipe {
  flex: 1;
  width: 16px;
  writing-mode: horizontal-tb;
  border-radius: 10px;
  background:
    repeating-linear-gradient(#2a2a2a 0 10px, #1a1a1a 10px 12px),
    linear-gradient(90deg, #333, #666 40%, #222);
  box-shadow: inset 3px 0 4px #000, 0 0 8px #00ff6622;
  position: relative;
}
.rad-tube__pipe::after {
  content: "";
  position: absolute; left: 4px; right: 4px; height: 18px;
  border-radius: 50%;
  background: #00ff6688;
  box-shadow: 0 0 12px var(--g);
  animation: rad-capsule 2.8s ease-in-out infinite;
}
@keyframes rad-capsule {
  0%, 100% { top: 8%; opacity: .4; }
  50% { top: 72%; opacity: 1; }
}
.rad-tube:hover, .rad-tube.is-lit {
  border-color: var(--g);
  box-shadow: 0 0 18px #00ff6633;
}
.rad-shell[data-view="mail"] .rad-tube__pipe::after { animation-duration: .7s; }

.rad-crt .rad-file button[type="submit"] {
  background: transparent; color: var(--g); border: 1px solid var(--g);
  padding: 8px 12px; cursor: pointer; font-weight: 700;
}

.rad-nav {
  position: relative; z-index: 3;
  display: flex; gap: 6px;
  margin: 8px 16px 0;
}
.rad-nav button {
  flex: 1;
  background: #0a0a0a; color: var(--g); border: 1px solid #00ff6655;
  padding: 10px 8px; cursor: pointer; letter-spacing: 2px; font-weight: 700;
}
.rad-nav button[aria-pressed="true"], .rad-nav button:hover {
  background: var(--g); color: #000;
}
.rad-bins {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0;
}
.rad-bins--deck { grid-template-columns: repeat(2, 1fr); margin: 0; }
.rad-bin {
  background: #031408; color: var(--g); border: 1px solid #00ff6655;
  padding: 8px 6px; cursor: pointer; display: flex; flex-direction: column; gap: 2px;
}
.rad-bin em { font-style: normal; opacity: .7; font-size: .8rem; }
.rad-bin.is-open, .rad-bin:hover { border-color: var(--g); background: #00ff6618; }
.rad-bins--deck .rad-bin {
  background: linear-gradient(#3a2814, #22160c);
  color: #e8d2a0;
  border-color: #5a4028;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
}
.rad-flip {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px;
}
.rad-space__fig { margin-bottom: 8px; }
.rad-cab .rad-list {
  background: #031408ee;
  border: 1px solid #00ff6633;
  padding: 8px;
  min-height: 8rem;
}
.rad-term .skin-rack { margin-top: 8px; }
.rad-term:has(.skin-rack) {
  white-space: normal;
  text-shadow: none;
}
.rad-shell[data-view="card"] .rad-stage {
  grid-template-columns: 1fr;
}
.rad-shell[data-view="card"] .rad-deck {
  display: none;
}
.rad-shell[data-view="card"] .rad-crt__glass {
  min-height: 22rem;
}
.rad-term .sc-preview {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 6.5rem;
  margin: 0 0 10px;
  padding: 10px 8px 12px;
  background:
    linear-gradient(rgba(3, 20, 8, .92), rgba(3, 20, 8, .88));
  border-bottom: 1px solid #00ff6633;
}
.rad-term .sc-preview .chrf-fig--edit {
  width: 72px;
  margin: 0;
}
.rad-term .sc-preview .fig-name {
  font-size: .72rem;
}
.rad-term .rad-card-hint { margin-top: 14px; }
.rad-term .sc-tabs button { font-size: .62rem; letter-spacing: .2px; padding: 5px 6px; }
.rad-index__cols--4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 980px) {
  .rad-index__cols--4 { grid-template-columns: 1fr 1fr; }
}

.rad-furn {
  width: min(128px, 24vw) !important;
  height: auto !important;
  min-height: 0;
  padding: 0 0 2px !important;
  background: transparent !important;
  border-color: transparent !important;
  color: #e8d2a0 !important;
}
.rad-furn:hover { background: transparent !important; color: var(--g) !important; border-color: #00ff6655 !important; }
.rad-furn__body {
  display: flex; flex-direction: column; align-items: center; width: 100%;
  pointer-events: none;
}
.rad-furn__rolo {
  width: 78%; height: 28px;
  background: radial-gradient(ellipse at 50% 120%, #3a2a18 40%, #1a1008);
  border: 2px solid #c4a056;
  border-radius: 40% 40% 8px 8px;
  box-shadow: inset 0 -4px 0 #0006;
}
.rad-furn__case {
  width: 88%; height: 72px;
  background: repeating-linear-gradient(#3a2814 0 16px, #2a1c10 16px 18px);
  border: 3px solid #6a4a28;
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 3px;
  padding: 5px; margin-top: 2px;
}
.rad-furn__case i {
  display: block; background: #22160c; border: 1px solid #c4a05666;
  box-shadow: inset 0 -3px 0 #c4a05644;
}

@media (max-width: 980px) {
  .rad-stage { grid-template-columns: 1fr; }
  .rad-deck { min-height: 52vh; }
  .rad-bins { grid-template-columns: repeat(2, 1fr); }
  .rad-tab { width: 64px; height: 100px; flex-basis: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .rad-tube__pipe::after, .rad-shell[data-view="idle"] .rad-term::after { animation: none; }
}
