:root { color-scheme: light dark; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    line-height: 1.35;
    background: hsl(210, 20%, 12%);
    color: hsl(0, 0%, 98%);
    display: flex;
    flex-direction: column;
    align-items: center;
}
header {
    width: 100%;
    padding: 16px 20px;
    text-align: center;
    background: linear-gradient(180deg, hsl(210, 15%, 16%), hsl(210, 20%, 12%));
    position: sticky;
    top: 0;
    z-index: 2;
}
header h1 { margin: 0 0 6px; font-size: 20px; font-weight: 700; }
header p { margin: 0; opacity: 0.8; font-size: 13px; }

.app {
    width: 100%;
    max-width: 1100px;
    padding: 18px 16px 28px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}
@media (min-width: 860px) {
    .app { grid-template-columns: 1fr 1fr; align-items: start; }
}

.roller-card {
    background: hsl(210, 15%, 16%);
    border: 1px solid hsl(210, 12%, 22%);
    border-radius: 12px;
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.roller-title { margin: 6px 0 12px; font-size: 16px; font-weight: 700; }

.roller-wrap { position: relative; width: 100%; display: flex; justify-content: center; }

.roller-frame {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: calc(min(86vw, 460px) - 8px);
    height: 60px; /* row height */
    border-radius: 8px;
    box-shadow: 0 0 0 2px hsl(48, 100%, 60%) inset, 0 0 24px rgba(0,0,0,0.4);
    pointer-events: none;
    z-index: 2;
}

.roller-viewport {
    width: min(86vw, 460px);
    height: 180px; /* shows ~3 rows */
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid hsl(210, 12%, 22%);
    background: hsl(210, 15%, 14%);
    position: relative;
}

.roller-list {
    list-style: none;
    padding: 0; margin: 0;
    transform: translateY(0);
}

.roller-item {
    height: 60px; /* row height used in JS */
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 16px;
    color: white;
}
.roller-item:nth-child(odd) { background: hsl(210, 15%, 18%); }
.roller-item:nth-child(even){ background: hsl(210, 15%, 22%); }
.roller-item.active { outline: 2px solid hsl(48, 100%, 60%); outline-offset: -2px; }

.controls { margin-top: 14px; display: flex; gap: 8px; }
button {
    appearance: none;
    border: 1px solid hsl(210, 12%, 30%);
    background: hsl(210, 12%, 22%);
    color: white;
    padding: 10px 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.05s;
}
button:hover { background: hsl(210, 12%, 26%); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: not-allowed; }

.result { margin-top: 10px; font-size: 14px; opacity: 0.9; min-height: 1.4em; text-align: center; }
.visually-hidden { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
    .roller-list { transition: none !important; }
}


