html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #1B1F23;
}

.tly-root {
  --ink: #1B1F23;
  --ink2: #12151A;
  --paper: #EDE4C8;
  --paper2: #F6F1DE;
  --brass: #C08A28;
  --brass-dark: #8C6318;
  --signal: #C1432E;
  --teal: #3E6259;
  --text: #F3EFE3;
  --muted: #9AA0A6;
  min-height: 100vh;
  width: 100%;
  background: radial-gradient(1200px 600px at 50% -10%, #22262C 0%, var(--ink) 55%);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px 64px;
  box-sizing: border-box;
}
.tly-root * { box-sizing: border-box; }

.tly-wrap { width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 20px; }

.tly-wordmark {
  font-family: 'Big Shoulders Display', sans-serif; font-weight: 800;
  font-size: 3.4rem; letter-spacing: .05em; color: var(--brass); text-align: center; line-height: 1;
  margin: 8px 0 0;
}
.tly-sub {
  text-align: center; font-family: 'DM Mono', monospace; font-size: .72rem;
  letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 6px 0 0;
}
.tly-tagline { text-align: center; color: var(--text); opacity: .85; font-size: 1rem; margin: 18px 0 6px; }
.tly-hint { text-align: center; color: var(--muted); font-size: .82rem; margin-top: -4px; }

.tly-cta-row { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.tly-btn {
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: .98rem; border-radius: 10px;
  padding: 14px 18px; cursor: pointer; border: 2px solid transparent; transition: transform .08s ease, filter .12s ease;
}
.tly-btn:active { transform: scale(.98); }
.tly-btn:disabled { opacity: .4; cursor: not-allowed; }
.tly-btn:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }
.tly-btn-primary { background: var(--brass); color: var(--ink2); border-color: var(--brass); }
.tly-btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.tly-btn-outline { background: transparent; color: var(--paper2); border-color: var(--brass-dark); }
.tly-btn-outline:hover:not(:disabled) { border-color: var(--brass); }
.tly-btn-signal { background: var(--signal); color: var(--paper2); border-color: var(--signal); }

.tly-card { background: var(--ink2); border: 1px solid #2A2F36; border-radius: 14px; padding: 22px; }

.tly-label {
  font-family: 'DM Mono', monospace; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); display: block; margin-bottom: 6px;
}
.tly-field { margin-bottom: 16px; }
.tly-input {
  width: 100%; background: var(--ink); border: 1.5px solid #383E46; border-radius: 8px; color: var(--text);
  padding: 11px 12px; font-size: 1rem; font-family: 'Inter', sans-serif;
}
.tly-input:focus-visible, .tly-input:focus { outline: none; border-color: var(--brass); }
.tly-error { color: #E8836F; font-size: .85rem; margin-top: 4px; margin-bottom: 12px; }

.tly-back {
  background: none; border: none; color: var(--muted); font-size: .85rem; cursor: pointer;
  align-self: flex-start; padding: 4px 0; font-family: 'Inter', sans-serif;
}
.tly-back:hover { color: var(--paper2); }

.tly-h1 {
  font-family: 'Big Shoulders Display', sans-serif; font-weight: 700; font-size: 1.7rem;
  letter-spacing: .02em; margin: 0 0 4px; color: var(--paper2);
}

.tly-code-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.tly-code { font-family: 'DM Mono', monospace; font-size: 2rem; letter-spacing: .12em; color: var(--brass); }
.tly-copy {
  background: transparent; border: 1.5px solid var(--brass-dark); color: var(--paper2);
  border-radius: 8px; padding: 6px 12px; font-size: .8rem; cursor: pointer; font-family: 'Inter', sans-serif;
}

.tly-slots { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.tly-slot {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  background: var(--ink); border: 1px solid #2A2F36; font-size: .95rem;
}
.tly-slot.tly-empty { color: var(--muted); font-style: italic; border-style: dashed; }
.tly-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); flex-shrink: 0; }
.tly-empty .tly-dot { background: #3A3F46; }
.tly-tag {
  font-family: 'DM Mono', monospace; font-size: .65rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--brass); border: 1px solid var(--brass-dark); border-radius: 4px; padding: 2px 6px; margin-left: auto;
}
.tly-progress { font-family: 'DM Mono', monospace; font-size: .8rem; color: var(--muted); margin-bottom: 2px; }
.tly-limitline { font-size: .85rem; color: var(--muted); margin-bottom: 18px; }

.tly-drum-row { display: flex; gap: 8px; justify-content: center; }
.tly-drum {
  background: linear-gradient(180deg, var(--paper2), var(--paper)); border: 3px solid var(--brass-dark);
  border-radius: 7px; width: 58px; height: 78px; display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 3px 6px rgba(0,0,0,.35), 0 2px 0 var(--brass-dark); position: relative; overflow: hidden;
}
.tly-drum::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0,0,0,.15); }
.tly-drum-digit {
  font-family: 'DM Mono', monospace; font-size: 2.3rem; font-weight: 500; color: var(--ink);
  display: inline-block; animation: tlySpin .35s ease-out;
}
.tly-drum-row.tly-signal .tly-drum { border-color: var(--signal); }
@keyframes tlySpin {
  0% { transform: translateY(-100%) rotateX(60deg); opacity: 0; }
  60% { transform: translateY(6%) rotateX(-10deg); opacity: 1; }
  100% { transform: translateY(0) rotateX(0deg); }
}

.tly-game { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.tly-countof { text-align: center; font-family: 'DM Mono', monospace; color: var(--muted); font-size: .85rem; }
.tly-last { text-align: center; font-size: .9rem; color: var(--paper2); min-height: 1.2em; }
.tly-last b { color: var(--brass); }
.tly-press-btn {
  width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #E4573A, #A83322 70%); border: 6px solid var(--brass-dark);
  color: var(--paper2); font-family: 'Big Shoulders Display', sans-serif; font-size: 1.5rem; letter-spacing: .08em;
  text-transform: uppercase; box-shadow: 0 8px 0 #6b1f11, 0 10px 18px rgba(0,0,0,.4); cursor: pointer;
  transition: transform .06s ease, box-shadow .06s ease;
}
.tly-press-btn:active:not(:disabled) { transform: translateY(6px); box-shadow: 0 2px 0 #6b1f11, 0 4px 10px rgba(0,0,0,.4); }
.tly-press-btn:disabled { filter: grayscale(1); opacity: .35; cursor: not-allowed; box-shadow: none; }
.tly-press-btn:focus-visible { outline: 3px solid var(--brass); outline-offset: 4px; }
.tly-me { text-align: center; color: var(--muted); font-size: .8rem; }

.tly-alarm {
  border: 2px solid var(--signal); border-radius: 12px; padding: 16px 18px; text-align: center;
  animation: tlyPulse 1.4s ease-in-out infinite;
}
@keyframes tlyPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(193,67,46,.4); }
  50% { box-shadow: 0 0 0 8px rgba(193,67,46,0); }
}
.tly-alarm-title { font-family: 'Big Shoulders Display', sans-serif; font-size: 1.6rem; color: var(--signal); letter-spacing: .04em; margin: 0; }
.tly-alarm-sub { color: var(--muted); font-size: .85rem; margin-top: 4px; }

.tly-order-list {
  list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px;
  max-height: 260px; overflow-y: auto;
}
.tly-order-list li {
  display: flex; gap: 10px; align-items: center; background: var(--ink); border: 1px solid #2A2F36;
  border-radius: 7px; padding: 8px 10px; font-size: .9rem;
}
.tly-order-idx { font-family: 'DM Mono', monospace; color: var(--brass); min-width: 26px; text-align: right; }

.tly-rounds { margin-top: 16px; border-top: 1px solid #2A2F36; padding-top: 14px; }
.tly-round { border: 1px solid #2A2F36; border-radius: 8px; margin-top: 6px; overflow: hidden; }
.tly-round-head {
  width: 100%; display: flex; justify-content: space-between; background: var(--ink); border: none;
  color: var(--paper2); padding: 10px 12px; cursor: pointer; font-family: 'Inter', sans-serif; font-size: .88rem;
}
.tly-round-meta { color: var(--muted); font-family: 'DM Mono', monospace; font-size: .78rem; }
.tly-round .tly-order-list { padding: 10px; background: var(--ink2); margin: 0; }

.tly-list-cards { display: flex; flex-direction: column; gap: 10px; }
.tly-scard {
  background: var(--ink2); border: 1px solid #2A2F36; border-radius: 10px; padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; text-align: left;
  width: 100%; color: var(--text); font-family: 'Inter', sans-serif;
}
.tly-scard:hover { border-color: var(--brass-dark); }
.tly-scard-name { font-weight: 600; color: var(--paper2); }
.tly-scard-meta { color: var(--muted); font-size: .8rem; font-family: 'DM Mono', monospace; margin-top: 2px; }

@media (prefers-reduced-motion: reduce) {
  .tly-drum-digit { animation: none; }
  .tly-alarm { animation: none; }
  .tly-btn, .tly-press-btn { transition: none; }
}
