:root {
    --bg: #f3f1ec;
    --fg: #151515;
    --muted: rgb(21 21 21 / 55%);
    --line: rgb(21 21 21 / 12%);
    --cell: #e4e1da;
    color-scheme: light;
}

:root[data-theme='dark'] {
    --bg: #0f0f0e;
    --fg: #eeeeea;
    --muted: rgb(238 238 234 / 55%);
    --line: rgb(238 238 234 / 14%);
    --cell: #1d1d1b;
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
}

body {
    font: 16px/1.4 -apple-system, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

[hidden] {
    display: none !important;
}

.label {
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}

.roll {
    max-width: 560px;
    margin: 0 auto;
    padding: 28px 20px calc(40px + env(safe-area-inset-bottom));
}

.roll__title {
    margin: 0 0 12px;
    font-size: 44px;
    line-height: 1;
    letter-spacing: -0.03em;
}

.roll__status,
.roll__mine {
    margin: 0;
}

.roll__mine {
    margin-top: 4px;
    color: var(--fg);
}

.roll__message {
    margin: 32px 0;
    font-size: 17px;
}

.roll__action {
    margin: 28px 0 32px;
}

.roll__picker {
    display: none;
}

.button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    padding: 0 20px;
    border: 0;
    border-radius: 14px;
    background: var(--fg);
    color: var(--bg);
    font: inherit;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
}

.button + .button {
    margin-top: 8px;
}

.button_ghost {
    background: transparent;
    color: var(--fg);
}

.sheet {
    margin: 0 0 32px;
    padding: 20px 0 0;
    border-top: 1px solid var(--line);
}

.sheet__title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
}

.sheet__note {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 15px;
}

.sheet__actions {
    margin-top: 20px;
}

.sheet__progress {
    height: 2px;
    margin: 16px 0 10px;
    background: var(--line);
}

.sheet__bar {
    height: 100%;
    background: var(--fg);
    transition: width 0.2s linear;
}

.frames__title {
    margin: 0 0 12px;
}

.frames__empty {
    margin: 0;
    color: var(--muted);
}

.frames__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.frame {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: var(--cell);
    cursor: pointer;
}

.frame__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.frame__time,
.frame__video {
    position: absolute;
    font-size: 10px;
    color: #fff;
    text-shadow: 0 1px 2px rgb(0 0 0 / 60%);
}

.frame:not(:has(.frame__image)) :is(.frame__time, .frame__video) {
    color: var(--muted);
    text-shadow: none;
}

.frame__time {
    left: 6px;
    bottom: 5px;
}

.frame__video {
    top: 5px;
    right: 6px;
}

.tabs {
    display: flex;
    gap: 20px;
    margin: 0 0 16px;
}

.tabs__tab,
.people__chip {
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.tabs__tab {
    padding-bottom: 4px;
    border-bottom: 1px solid transparent;
}

.tabs__tab[aria-pressed='true'] {
    border-bottom-color: var(--fg);
    color: var(--fg);
}

.people {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
}

.people__chip {
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.people__chip[aria-pressed='true'] {
    border-color: var(--fg);
    background: var(--fg);
    color: var(--bg);
}

.frame__author {
    position: absolute;
    top: 5px;
    left: 6px;
    max-width: calc(100% - 52px);
    overflow: hidden;
    font-size: 10px;
    color: #fff;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgb(0 0 0 / 60%);
}

.frame:not(:has(.frame__image)) .frame__author {
    color: var(--muted);
    text-shadow: none;
}

.viewer {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    background: #000;
}

.viewer__stage {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.viewer__media {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.viewer__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
}

.viewer__caption,
.viewer__close {
    margin: 0;
    color: rgb(255 255 255 / 75%);
}

.viewer__close {
    padding: 8px 0;
    border: 0;
    background: none;
    cursor: pointer;
}
