/* Zvaž Vědu! event-app composition, adapted for the Herzigcoin game. */

:root {
    --app-width: min(100%, 770px);
    --app-gutter: 20px;
    --app-nav-height: 68px;
    
    font-size: 16px;
}

@media (min-width: 600px) {
    :root {
        font-size: 20px;
    }
}

html,
body {
    min-height: 100%;
}

html {
    background: #e9e7e5;
}

body.zv-app-body {
    display: flex;
    justify-content: center;
    align-items: stretch;
    margin: 0;
    min-height: 100vh;
    color: var(--white-zv);
    background: #e9e7e5;
}

.app-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    width: var(--app-width);
    min-height: 100vh;
    overflow: clip;
    background: var(--black-zv);
    box-shadow: 0 0 0 1px rgba(35, 31, 32, .08), 0 12px 40px rgba(35, 31, 32, .12);
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    flex: 0 0 auto;
    padding: 14px var(--app-gutter) 11px;
    background: var(--black-zv);
}

.app-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding-bottom: 11px;
    border-bottom: 1px solid rgba(242, 242, 242, .2);
}

.app-brand {
    display: block;
    flex: 0 0 auto;
    width: 120px;
    line-height: 0;
}

.app-brand img {
    display: block;
    width: 100%;
    height: auto;
    background: #f2f2f2;
}

.app-header-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 1px;
    text-align: right;
}

.app-header-meta strong {
    color: #f2f2f2;
    font-family: 'ZV-Display', sans-serif;
    font-size: 1.1429rem;
    line-height: 1.05;
}

.app-header-meta span {
    color: #d3ced0;
    font-family: 'ZV-Regular', sans-serif;
    font-size: 0.7143rem;
    line-height: 1.1;
}

.app-content-container {
    flex: 1 0 auto;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    padding: 0 0 calc(var(--app-nav-height) + 10px);
    margin: 0;
}

.app-content-container main {
    display: block;
    width: 100%;
}

.app-content {
    display: flex;
    flex-direction: column;
    width: auto;
    max-width: none;
    gap: 18px;
    padding: 22px var(--app-gutter) 26px;
    margin: 0;
}

.app-content>* {
    min-width: 0;
}

.app-shell footer {
    display: none !important;
}

/* Bottom navigation matches the three-cell event app navigation. */
.app-bottom-nav {
    position: fixed;
    z-index: 1000;
    left: 50%;
    top: auto;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: min(100%, var(--app-width));
    min-height: var(--app-nav-height);
    padding-bottom: env(safe-area-inset-bottom, 0);
    transform: translateX(-50%);
    background: var(--black-zv);
    border-top: 1px solid var(--zv-yellow);
}

.app-tab {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 7px 3px 6px;
    color: var(--white-zv) !important;
    text-decoration: none !important;
    font-family: 'ZV-Display', sans-serif;
    font-size: 0.7143rem;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
    border-right: 1px solid rgba(242, 242, 242, .08);
    transition: background .15s ease, color .15s ease;
}

.app-tab:last-child {
    border-right: 0;
}

.app-tab svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: square;
    stroke-linejoin: miter;
}

.app-tab.is-active {
    color: var(--black-zv) !important;
    background: var(--zv-yellow);
}

.app-tab:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
}

/* Reference screen heading and yellow skew marker. */
.screen-intro {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.screen-intro h1,
.app-content h1 {
    position: relative;
    z-index: 0;
    isolation: isolate;
    max-width: 100%;
    margin: 4px 0 3px;
    color: var(--white-zv);
    font-family: 'ZV-Display', sans-serif;
    font-size: clamp(2.2857rem, 9vw, 2.8571rem);
    line-height: .98;
    text-transform: uppercase;
}

.screen-intro h1::after,
.app-content h1::after {
    position: absolute;
    z-index: -1;
    left: -.05em;
    bottom: .02em;
    width: 103%;
    height: .16em;
    content: '';
    background: var(--zv-yellow);
    rotate: -2deg;
}

.screen-subtitle {
    margin: 4px 0 0;
    color: var(--white-zv);
    font-family: 'ZV-Display', sans-serif;
    font-size: 1rem;
    line-height: 1.2;
    text-transform: uppercase;
}

.screen-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.section-title-row {
    display: flex;
    align-items: baseline;
    margin-top: 20px;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(242, 242, 242, .18);
}

.section-title-row h2 {
    margin: 0;
    color: var(--white-zv);
    font-family: 'ZV-Display', sans-serif;
    font-size: 1.4286rem;
    line-height: 1.05;
    text-transform: uppercase;
}

.section-index {
    color: rgba(242, 242, 242, .65);
    font-family: 'ZV-Regular', sans-serif;
    font-size: 0.7143rem;
    white-space: nowrap;
}

.screen-note {
    margin: 0;
    color: rgba(242, 242, 242, .72);
    font-size: 0.8571rem;
    line-height: 1.4;
}

.app-photo-hero {
    position: absolute;
    z-index: 5;
    top: 96px;
    right: var(--app-gutter);
    width: 140px;
    height: 150px;
}

.app-photo-frame {
    position: absolute;
    top: 8px;
    left: 0;
    width: 98px;
    height: 124px;
    padding: 5px;
    background: var(--zv-yellow);
}

.app-photo-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-photo-frame {
    z-index: 2;
}

.app-photo-hero .app-photo-cat {
    position: absolute;
    z-index: 1;
    top: 22px;
    right: 0;
    width: 64px;
    height: auto;
}

.app-photo-credit {
    position: absolute;
    right: 0;
    bottom: 0;
    margin: 0;
    color: rgba(242, 242, 242, .65);
    font-size: 0.5714rem !important;
    text-align: right;
}

.app-photo-credit a {
    color: var(--zv-yellow);
}

.app-content>.screen-intro:first-child,
.app-content>header:first-child,
.app-content>.claim-heading:first-child {
    min-height: 150px;
    padding-right: 145px;
}

.app-content>h1:first-child {
    min-height: 150px;
    max-width: calc(100% - 145px);
}

.app-content>.success-panel:first-child {
    margin-top: 150px;
}

.app-logout-link {
    color: var(--zv-yellow);
    font-family: 'ZV-Display', sans-serif;
    font-size: 0.7143rem;
    text-decoration: none;
}

.app-logout-link:hover {
    color: var(--white-zv);
    text-decoration: underline;
}

.app-info-links {
    display: flex;
    justify-content: center;
    gap: 18px;
    padding: 12px 0 2px;
    border-top: 1px solid rgba(242, 242, 242, .16);
}

.app-info-links a {
    color: rgba(242, 242, 242, .72);
    font-family: 'ZV-Display', sans-serif;
    font-size: 0.7143rem;
    text-decoration: none;
    text-transform: uppercase;
}

.app-info-links a:hover {
    color: var(--zv-yellow);
}

.account-switch {
    margin: 10px 0 0;
    color: var(--black-zv);
    font-size: 0.8571rem !important;
    text-align: center;
}

.account-switch a {
    color: var(--black-zv) !important;
    font-family: 'ZV-Display', sans-serif;
}

.account-home-link {
    display: block;
    margin-top: 10px;
    color: var(--black-zv);
    font-family: 'ZV-Display', sans-serif;
    font-size: 0.7143rem;
    text-align: center;
    text-decoration: none;
}

.account-home-link:hover {
    text-decoration: underline;
}

#leaderboard .name a {
    color: inherit;
    text-decoration: none;
}

#leaderboard .name a:hover {
    color: var(--zv-yellow);
    text-decoration: underline;
}

/* Yellow information panels and segmented, squared-off controls. */
.feature-panel,
.screen-yellow-callout,
.claim-action-panel,
.scoring-panel {
    padding: 15px;
    color: var(--black-zv);
    background: var(--zv-yellow);
    border: 1px solid var(--zv-yellow);
}

.feature-panel-label,
.scoring-heading {
    margin: 0 0 8px;
    color: var(--black-zv);
    font-family: 'ZV-Display', sans-serif;
    font-size: 1rem;
    text-transform: uppercase;
}

.feature-panel h2,
.screen-yellow-callout h2,
.claim-action-panel h2 {
    margin: 0 0 9px;
    color: var(--black-zv);
    font-family: 'ZV-Display', sans-serif;
    font-size: 1.7143rem;
    line-height: 1;
    text-transform: uppercase;
}

.feature-panel p,
.screen-yellow-callout p,
.claim-action-panel p {
    margin: 0 0 10px;
    color: var(--black-zv);
    font-family: 'ZV-Regular', sans-serif;
    font-size: var(--main-font-size);
    line-height: 1.42;
}

.feature-panel p+p {
    margin-top: 8px;
}

.screen-button,
.app-content a.primary-button,
.app-content button,
.app-content input[type=submit] {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 42px;
    width: 100%;
    padding: 10px 13px;
    color: var(--black-zv) !important;
    background: var(--zv-yellow) !important;
    border: 1px solid var(--zv-yellow) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-family: 'ZV-Display', sans-serif;
    font-size: var(--main-font-size);
    line-height: 1.1;
    text-align: left;
    text-decoration: none !important;
    text-transform: uppercase;
    cursor: pointer;
}

.screen-button-dark,
.feature-panel .screen-button,
.screen-yellow-callout .screen-button,
.claim-action-panel .screen-button {
    color: var(--zv-yellow) !important;
    background: var(--black-zv) !important;
    border-color: var(--black-zv) !important;
}

.screen-button-outline {
    color: var(--white-zv) !important;
    background: transparent !important;
    border-color: var(--zv-yellow) !important;
}

.screen-button:hover {
    filter: brightness(1.12);
}

.step-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--zv-yellow);
}

.step-row {
    display: grid;
    grid-template-columns: 35px minmax(0, 1fr) 16px;
    align-items: start;
    gap: 9px;
    padding: 11px 10px;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--zv-border-yellow);
    transition: background .15s ease;
}

.step-row:last-child {
    border-bottom: 0;
}

.step-row:hover {
    background: rgba(242, 242, 242, .06);
}

.step-row:focus-visible {
    outline: 2px solid var(--zv-yellow);
    outline-offset: -2px;
}

.step-number {
    color: var(--zv-yellow);
    font-family: 'ZV-Display', sans-serif;
    font-size: 1.1429rem;
}

.step-row strong {
    display: block;
    color: var(--white-zv);
    font-family: 'ZV-Display', sans-serif;
    font-size: var(--main-font-size);
    line-height: 1.15;
}

.step-row p {
    margin: 4px 0 0;
    color: rgba(242, 242, 242, .8);
    font-size: 0.8571rem;
    line-height: 1.35;
}

.step-arrow {
    align-self: center;
    color: var(--zv-yellow);
    font-size: 1.1429rem;
    font-family: 'ZV-Display';
}

.screen-yellow-callout {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.screen-yellow-callout h2 {
    margin-bottom: 4px;
}

/* Compact score summary for leaderboard screen. */
.scoring-panel {
    padding: 10px 12px;
}

.scoring-heading {
    margin: 0 0 7px;
}

.scoring-values {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

.scoring-values span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: var(--black-zv);
    font-family: 'ZV-Display', sans-serif;
    font-size: 0.7143rem;
    line-height: 1.1;
}

.scoring-values b {
    font-size: 1.5714rem;
    line-height: 1;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--zv-yellow);
    font-family: 'ZV-Display', sans-serif;
    font-size: 0.7143rem;
}

.live-indicator i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--zv-yellow);
}

.loading-row {
    padding: 14px 10px;
    color: rgba(242, 242, 242, .65);
    border: 1px solid var(--zv-border-yellow);
    font-family: 'ZV-Display', sans-serif;
    font-size: 0.8571rem;
}

/* User collection and collectible catalogue. */
.collection-stats {
    margin: 0;
    border: 1px solid var(--zv-yellow) !important;
    background: #2b2728 !important;
}

.collection-page-content>.screen-intro {
    min-height: 150px;
    padding-right: 145px;
}

.collection-stats .stat-row {
    padding: 10px 12px;
}

.collection-stats .stat-label {
    color: var(--white-zv);
    font-family: 'ZV-Display', sans-serif;
    font-size: 0.7143rem;
}

.collection-stats .stat-value,
.collection-stats .stat-rarity {
    color: var(--zv-yellow);
    font-family: 'ZV-Display', sans-serif;
    font-size: 1.1429rem;
}

.rarity-container {
    margin: 0 0 16px;
}

.rarity-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    color: var(--black-zv);
    background: var(--zv-yellow);
}

.rarity-heading h3 {
    margin: 0;
    color: var(--black-zv);
    font-family: 'ZV-Display', sans-serif;
    font-size: var(--main-font-size);
}

.rarity-heading span {
    font-size: 0.7143rem;
}

.collectible-tray {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 0;
}

.collectible {
    width: auto;
    min-width: 0;
    padding: 8px;
    gap: 7px;
    border-top: 0 !important;
}

.collectible picture {
    display: block;
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #1b191a;
}

.collectible picture img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.collectible-stats {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.collectible-row {
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-size: 0.7143rem;
    line-height: 1.2;
}

.collectible-row span {
    color: var(--zv-yellow);
    font-size: 0.5714rem;
}

.collectible-row strong {
    color: var(--white-zv);
    font-size: 0.8571rem;
    font-weight: normal;
}

.empty-state {
    padding: 16px 12px;
    border: 1px solid var(--zv-yellow);
}

.empty-state strong {
    color: var(--zv-yellow);
    font-family: 'ZV-Display', sans-serif;
    font-size: 1rem;
}

.empty-state p {
    margin: 6px 0 0;
    color: rgba(242, 242, 242, .75);
    font-size: 0.8571rem;
}

/* QR claim and success screens. */
.claim-action-panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    text-align: left;
}

.claim-chip-mark {
    display: grid;
    place-items: center;
    align-self: center;
    width: 74px;
    height: 74px;
    margin: 0 0 2px;
    color: var(--zv-yellow);
    background: var(--black-zv);
    border: 4px solid var(--black-zv);
    border-radius: 50%;
    font-family: 'ZV-Display', sans-serif;
    font-size: 2.5714rem;
}

.claim-action-panel h2,
.claim-action-panel p {
    text-align: center;
}

.claim-action-panel form {
    display: block;
    width: 100%;
    margin-top: 6px;
}

.claim-action-panel .claim-submit {
    margin: 0;
    max-width: none;
}

.success-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    padding: 18px 14px;
    border: 1px solid var(--zv-yellow);
    text-align: center;
}

.success-check {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    color: var(--black-zv);
    background: var(--zv-yellow);
    font-size: 2.1429rem;
}

.success-panel h1 {
    font-size: 2.1429rem;
}

.success-panel p {
    margin: 0;
    font-size: var(--main-font-size);
}

.success-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Account forms take the same width, spacing and colours as the other screens. */
#form-container {
    width: 100%;
    align-items: stretch;
}

#login {
    width: 100%;
    padding: 15px;
    margin: 0;
}

#login h3 {
    margin: 0 0 12px;
    font-size: 1.7143rem;
}

#login form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#login input {
    margin: 0;
}

#login label {
    justify-content: flex-start;
    font-size: 0.8571rem;
}

#login button {
    width: 100%;
    margin: 6px 0 0;
}

#register-warning {
    width: 100%;
    margin: 4px 0 0;
    font-size: 0.8571rem;
}

/* Legacy page components are kept square and constrained to the screen column. */
.app-content .layout-container {
    padding: 0;
}

.app-content .layout-content {
    width: 100%;
    padding: 0;
}

.app-content p {
    font-size: var(--main-font-size);
    line-height: 1.45;
}

.app-content h2 {
    font-size: 1.4286rem;
}

.app-content #table-container {
    overflow-x: auto;
}

@media (min-width: 431px) {
    .app-shell {
        margin: 0 auto;
    }
}

@media (max-width: 430px) {
    body.zv-app-body {
        background: var(--black-zv);
    }

    .app-shell {
        width: 100%;
        box-shadow: none;
    }

    .app-bottom-nav {
        width: 100%;
    }
}

@media (max-width: 360px) {
    :root {
        --app-gutter: 15px;
    }

    .app-brand {
        width: 108px;
    }

    .app-header-meta strong {
        font-size: 0.8571rem;
    }

    .app-tab {
        font-size: 0.7143rem;
    }

    .screen-intro h1 {
        font-size: 2.1429rem;
    }
}

/* The app remains a narrow, phone-width column on desktop too, so use compact table labels consistently. */
#leaderboard .long-label {
    display: none;
}

#leaderboard .short-label {
    display: inline;
}