*,
*::before,
*::after {
    box-sizing: border-box;
}

@font-face {
    font-family: "ArcheryApp";
    src: url("./fonts/archery-app.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "ArcheryHeadline";
    src: url("./fonts/Caveat-VariableFont_wght.ttf") format("truetype");
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #202020;
    --panel: #121212;
    --box: #232323;
    --text: #9a9a9d;
    --muted: #8b8b8e;
    --green: #2f7a38;
    --yellow: #ffd100;
    --red: #ff1352;
    --blue: #20b5cf;
    --radius: 18px;
    --gap-card-title: 10px;
}

html,
body {
    min-height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "ArcheryApp", Arial, sans-serif;
    font-size: 18px;
}

button,
input,
select {
    font: inherit;
    pointer-events: auto;
    position: relative;
    z-index: 2;
}

input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

button {
    -webkit-tap-highlight-color: transparent;
}

.archery-app {
    width: min(100%, 440px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 20px 20px 36px;
    background: var(--bg);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 50px;
    margin-bottom: 10px;
}

.topbar__left {
    display: flex;
    gap: 10px;
}

.icon-btn {
    width: 50px;
    height: 50px;
    border: 0;
    border-radius: 50%;
    background: #151515;
    color: var(--green);
    display: grid;
    place-items: center;
    padding: 14px;
}

.icon-btn img {
    width: 24px;
    height: 24px;
}

.avatar-holder {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: #151515;
    margin: -10px auto 10px;
}

.hero {
    margin: 0 0 16px;
    color: var(--green);
    font-family: "ArcheryHeadline", cursive;
    font-size: clamp(36px, 9.5vw, 46px);
    line-height: 0.98;
    font-weight: 700;
    text-align: center;
}

.page-title {
    margin: 0 0 10px;
    color: var(--green);
    font-family: "ArcheryHeadline", cursive;
    font-size: 34px;
    line-height: 1.08;
    font-weight: 700;
    text-align: center;
}

.stack {
    display: grid;
    gap: 18px;
}

.card {
    background: var(--panel);
    border-radius: var(--radius);
    padding: 24px 20px;
}

.card.form-card {
    padding: 20px;
}

.card--active {
    border: 1px solid var(--yellow);
}

.card-title {
    margin: 0;
    font-size: 24px;
    line-height: 1.1;
    font-weight: 700;
    color: var(--text);
    text-align: center;
}

.card-subtitle {
    margin: 0;
    font-size: 18px;
    line-height: 1.15;
    color: var(--muted);
    text-align: center;
}

.card-head {
    margin-bottom: var(--gap-card-title);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.metric,
.list-row {
    min-height: 74px;
    border: 0;
    border-radius: 8px;
    background: var(--box);
    color: var(--text);
    padding: 16px 20px;
    text-align: left;
}

.metric {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-wrap: anywhere;
}

.metric strong,
.green {
    color: var(--green);
}

.btn {
    width: 100%;
    min-height: 50px;
    border-radius: 999px;
    border: 1px solid var(--green);
    background: transparent;
    color: var(--green);
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
}

.btn:hover,
.btn:focus,
.btn:active {
    background: transparent;
    color: var(--green);
    outline: none;
}

.btn--primary,
.btn--primary:hover,
.btn--primary:focus,
.btn--primary:active {
    border-color: var(--green);
    background: var(--green);
    color: #fff;
}

.form-card {
    display: grid;
    gap: 6px;
}

.field {
    display: grid;
    gap: 4px;
    color: var(--muted);
}

.control {
    width: 100%;
    height: 52px;
    border: 1px solid #78787b;
    border-radius: 8px;
    background: var(--box);
    color: var(--text);
    padding: 0 18px;
    font-size: 24px;
    font-weight: 700;
    cursor: text;
}

select.control,
button.control {
    cursor: pointer;
}

select.control {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 46px;
}

.select-wrap {
    position: relative;
    display: block;
}

.select-wrap::after {
    content: "";
    position: absolute;
    right: 18px;
    top: 50%;
    width: 11px;
    height: 11px;
    border-right: 2px solid #9a9a9d;
    border-bottom: 2px solid #9a9a9d;
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
    z-index: 4;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.target-wrap {
    position: relative;
    display: block;
}

.target-button img,
.target-option img {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
}

.target-button {
    width: 100%;
    height: 52px;
    border: 1px solid #78787b;
    border-radius: 8px;
    background: var(--box);
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 46px 0 12px;
    font-size: 24px;
    font-weight: 700;
    text-align: left;
    position: relative;
    cursor: pointer;
}

.target-button::after {
    content: "";
    position: absolute;
    right: 18px;
    top: 50%;
    width: 11px;
    height: 11px;
    border-right: 2px solid #9a9a9d;
    border-bottom: 2px solid #9a9a9d;
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
}

.target-options {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% - 1px);
    z-index: 20;
    overflow: hidden;
    border: 1px solid #78787b;
    border-radius: 0 0 8px 8px;
    background: var(--box);
}

.target-option {
    width: 100%;
    min-height: 52px;
    border: 0;
    border-top: 1px solid #555;
    background: var(--box);
    color: var(--text);
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 8px 14px 8px 12px;
    font-size: 24px;
    font-weight: 700;
    text-align: left;
}

.target-option.is-selected {
    color: var(--green);
}

.target-wrap select {
    display: none;
    height: 50px;
    border: 0;
    background: transparent;
    padding-left: 66px;
    padding-right: 46px;
}

.number-stepper {
    position: relative;
}

.number-stepper .control {
    padding-right: 72px;
}

.number-stepper__button {
    position: absolute;
    top: 6px;
    width: 30px;
    height: 40px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #9a9a9d;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    z-index: 5;
}

.number-stepper__button[data-step="-1"] {
    right: 38px;
}

.number-stepper__button[data-step="1"] {
    right: 8px;
}

.number-stepper__button:active {
    color: var(--green);
}

.total {
    margin-top: 4px;
    color: var(--muted);
    font-style: italic;
    text-align: right;
}

.training-status {
    margin: 4px 0 0;
    text-align: center;
    font-style: italic;
}

.training-status strong {
    color: var(--green);
}

.score-slots {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    margin-bottom: 10px;
}

.score-slot {
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid #777;
    background: transparent;
    color: #fff;
    display: grid;
    place-items: center;
}

.end-total {
    margin: 0 0 10px;
    text-align: right;
    font-style: italic;
}

.score-pad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.score-btn {
    height: 60px;
    border: 0;
    border-radius: 8px;
    font-size: 24px;
    font-weight: 700;
}

.score-yellow { background: var(--yellow); color: #fff; }
.score-red { background: var(--red); color: #fff; }
.score-blue { background: var(--blue); color: #fff; }
.score-black { background: #000; color: #fff; }
.score-white { background: #f7f7f7; color: #000; }
.score-neutral { background: #000; color: #fff; }

.notice {
    padding: 16px;
    border-radius: 8px;
    background: var(--box);
    color: var(--text);
}

@media (min-width: 700px) {
    .archery-app {
        width: min(100%, 620px);
    }
}
