/* ============================================================
   Game Area Shell — .ga-* prefix
   Used by pages/game/gameShell.php
   ============================================================ */

/* ── Navigation Bar ── */
.ga-nav {
    border-radius: 10px;
    border: 2px solid #8b4513;
    padding: 8px 12px;
    margin: 8px auto;
    max-width: 600px;
    background-color: rgba(60, 47, 47, 0.85);
    font-family: 'Uncial Antiqua', cursive;
    font-size: 13px;
    color: #efe0a0;
    text-align: center;
}

.ga-nav span {
    color: #e99401;
    cursor: pointer;
    text-decoration: none;
}

.ga-nav .ga-sep {
    color: #efe0a0;
    cursor: default;
}

/* ── Active Tab ── */
.ga-nav span.ga-active {
    color: #fff;
    text-shadow: 0 0 4px #fbbe5d;
}

/* ── QR Glow Animation ── */
.ga-nav span.ga-glow {
    -webkit-animation: gaGlow 2s ease-in-out infinite alternate;
    -moz-animation: gaGlow 2s ease-in-out infinite alternate;
    animation: gaGlow 2s ease-in-out infinite alternate;
}

@-webkit-keyframes gaGlow {
    from { text-shadow: 0 0 0px #e99401, 0 0 0px #e99401; }
    to   { text-shadow: 0 0 1px #fbbe5d, 0 0 2px #fbbe5d; }
}
@keyframes gaGlow {
    from { text-shadow: 0 0 0px #e99401, 0 0 0px #e99401; }
    to   { text-shadow: 0 0 1px #fbbe5d, 0 0 2px #fbbe5d; }
}

/* ── Content Box ── */
.ga-content-box {
    background-color: rgba(0, 0, 0, 0.5);
    border: 2px solid #8b4513;
    border-radius: 15px;
    width: 100%;
    max-width: 600px;
    margin: 6px auto;
    padding: 8px;
}

/* ── AJAX Links Inside Content ── */
.ga-link {
    color: #e99401;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}
.ga-link:hover {
    color: #ff8b0f;
    text-shadow: 0 0 6px rgba(233, 148, 1, 0.4);
}

/* ── Welcome Banner ── */
#ga-welcome {
    text-align: center;
    padding: 12px 8px 6px;
}
#ga-welcome .ga-welcome-name {
    font-size: 16px;
    font-weight: bold;
    color: #ff8b0f;
}
#ga-welcome .ga-welcome-text {
    font-size: 14px;
    color: #ccc;
    margin-top: 4px;
}
#ga-welcome hr {
    border-color: #505056;
    margin: 10px auto;
    max-width: 80%;
}

/* ── Panel (replaces readoutBox inside ga-content-box) ── */
.ga-panel {
}

.ga-panel-title {
    color: #ff8b0f;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 10px;
    border-bottom: 1px solid #8b4513;
    padding-bottom: 6px;
    font-family: 'Uncial Antiqua', cursive;
}

/* ── Stat Cards ── */
.ga-stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 10px;
}

.ga-stat-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #8b4513;
    border-radius: 6px;
    padding: 10px 14px;
    text-align: center;
    min-width: 100px;
    flex: 1;
    max-width: 180px;
}

.ga-stat-card .ga-stat-label {
    color: #999;
    font-size: 11px;
    text-transform: uppercase;
    margin-bottom: 4px;
    font-family: 'open_sansregular', sans-serif;
}

.ga-stat-card .ga-stat-value {
    color: #ff8b0f;
    font-size: 16px;
    font-weight: bold;
}

/* ── Form Elements ── */
.ga-form-group {
    margin-bottom: 12px;
}

.ga-form-group label {
    display: block;
    color: #efe0a0;
    font-size: 13px;
    margin-bottom: 4px;
}

.ga-form-group select,
.ga-form-group input[type="text"],
.ga-form-group input[type="password"],
.ga-form-group textarea {
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid #8b4513;
    border-radius: 4px;
    color: #efe0a0;
    padding: 6px 10px;
    font-size: 13px;
    max-width: 300px;
    width: 100%;
}

.ga-form-group select:focus,
.ga-form-group input:focus,
.ga-form-group textarea:focus {
    outline: none;
    border-color: #e99401;
}

/* ── Radio/Toggle Row (legacy) ── */
.ga-radio-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    color: #efe0a0;
    font-size: 13px;
}

.ga-radio-row .ga-radio-label {
    min-width: 200px;
}

/* ── Preferences Table ── */
.ga-prefs-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    color: #efe0a0;
    margin: 12px 0;
}

.ga-prefs-table td {
    padding: 8px 14px;
    border-bottom: 1px solid rgba(139, 69, 19, 0.25);
    white-space: nowrap;
    vertical-align: middle;
}

.ga-prefs-table tr:last-child td {
    border-bottom: none;
}

.ga-prefs-table .ga-prefs-label {
    font-weight: bold;
    color: #ff8b0f;
    text-align: left;
    padding-right: 24px;
}

.ga-prefs-table label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ga-prefs-table input[type="radio"] {
    accent-color: #e99401;
    margin: 0;
    cursor: pointer;
}

/* ── Success/Error Alerts ── */
.ga-alert-success {
    color: #5cb85c;
    background: rgba(92, 184, 92, 0.1);
    border: 1px solid rgba(92, 184, 92, 0.3);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 13px;
    text-align: center;
}

.ga-alert-error {
    color: #d9534f;
    background: rgba(217, 83, 79, 0.1);
    border: 1px solid rgba(217, 83, 79, 0.3);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 13px;
}

/* ── Warning Box (Close Account) ── */
.ga-warning-box {
    background: rgba(233, 148, 1, 0.1);
    border: 1px solid rgba(233, 148, 1, 0.3);
    border-radius: 6px;
    padding: 12px;
    color: #efe0a0;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 12px;
}

/* ── Stats Display (shared with starting character screens) ── */
.sc-box {
    background: rgba(0,0,0,0.5);
    border: 1px solid #8b4513;
    border-radius: 15px;
    padding: 14px;
    margin-bottom: 10px;
}

.sc-section-title {
    color: #ff8b0f;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    margin: 10px 0 6px;
    border-bottom: 1px solid rgba(139,69,19,0.5);
    padding-bottom: 3px;
}

.sc-stats-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 12px;
    font-size: 12px;
    line-height: 1.6;
    max-width: 320px;
    margin: 0 auto;
}

.sc-stat-label { color: #ccc; text-align: left; }
.sc-stat-value { text-align: center; white-space: nowrap; }
.sc-stat-base { color: #ccc; }
.sc-stat-modified { color: #ff8b0f; font-weight: bold; }
.sc-stat-alt { background-color: rgba(139,69,19,0.08); }

.sc-stats-legend {
    display: grid;
    grid-template-columns: 1fr auto;
    font-size: 10px;
    color: #999;
    padding: 0 0 2px;
    border-bottom: 1px solid rgba(139,69,19,0.3);
    margin-bottom: 4px;
    max-width: 320px;
    margin: 0 auto 4px;
}
.sc-stats-legend span:last-child { text-align: right; }

.sc-stat-separator {
    grid-column: 1/-1;
    border-bottom: 1px solid rgba(139,69,19,0.35);
    margin: 4px 0;
}

.sc-stats-2col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Inline Detail (expand below link) ── */
.sc-inline-detail:empty { display: none; }
.sc-inline-detail { margin-top: 8px; }
.sc-inline-detail .sc-box { padding: 10px; margin-bottom: 6px; }

.sc-link {
    color: #e99401;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}
.sc-link:hover {
    color: #ff8b0f;
    text-shadow: 0 0 6px rgba(233, 148, 1, 0.4);
}

/* ── Badge Chips (unified tier/stat/value display) ── */
.badge-chip {
    background: rgba(0,0,0,0.3);
    border: 1px solid #5a3a1a;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 10px;
    color: #999;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}
.badge-val  { color: #ff8b0f; font-weight: bold; }
.badge-row  { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.badge-row-center { justify-content: center; }

/* Unified action button row for detail views */
.detail-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}
.detail-actions .qrf-btn {
    margin-top: 0;
}

/* ── QRFest Dark Accordion ── */
.qrf-accordion-item {
    background-color: transparent;
    border: 1px solid #8b4513;
}
.qrf-accordion-item:first-of-type {
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}
.qrf-accordion-item:last-of-type {
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}
.qrf-accordion-item + .qrf-accordion-item {
    border-top: 0;
}
.qrf-accordion-button {
    background: rgba(0,0,0,0.5);
    color: #e99401;
    font-size: 13px;
    padding: 10px 14px;
    box-shadow: none;
    gap: 6px;
}
.qrf-accordion-button:not(.collapsed) {
    background: rgba(60,47,47,0.85);
    color: #ff8b0f;
    box-shadow: none;
}
.qrf-accordion-button:focus {
    box-shadow: none;
    border-color: #8b4513;
}
.qrf-accordion-button::after {
    filter: invert(60%) sepia(80%) saturate(500%) hue-rotate(15deg);
}
.qrf-accordion-body {
    background: rgba(0,0,0,0.3);
    color: #ccc;
    padding: 10px 12px;
    font-size: 12px;
}
.qrf-equipped {
    border-left: 3px solid #e99401;
}
.qrf-equip-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 0;
    margin-bottom: 4px;
}
.qrf-equip-label-equipped { color: #e99401; }
.qrf-equip-label-backup   { color: #999; }
.qrf-item-name {
    color: #e99401;
    font-size: 12px;
}
.qrf-count-badge {
    font-size: 10px;
}
/* Nested accordion tighter spacing */
.qrf-accordion .qrf-accordion .qrf-accordion-button {
    font-size: 12px;
    padding: 8px 10px;
}
.qrf-accordion .qrf-accordion .qrf-accordion-body {
    padding: 8px 10px;
}
/* Hide Back button inside accordion body */
.qrf-accordion-body .qrf-btn-back {
    display: none;
}

/* Aliases for backward compatibility with merchant pages */
.tier-chip {
    background: rgba(0,0,0,0.3);
    border: 1px solid #5a3a1a;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 10px;
    color: #999;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}
.tier-val { color: #ff8b0f; font-weight: bold; }

/* ── Responsive ── */
@media (max-width: 480px) {
    .ga-nav {
        font-size: 11px;
        padding: 6px 8px;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
}
@media (min-width: 768px) {
    .ga-content-box {
        max-width: 900px;
    }
    .ga-nav {
        max-width: 900px;
    }
    .sc-stats-2col {
        flex-direction: row;
        gap: 20px;
    }
    .sc-stats-2col > div {
        flex: 1;
    }
}

/* ============================================================
   QR Scanner Section — .qr-* prefix
   Used by findQrsInner.php (methods 1 & 2)
   ============================================================ */

/* ── Text Helpers ── */
.qr-highlight { color: #f2690e; }
.qr-text-white { color: #fff; }

/* ── Scan Counter ── */
.qr-scans-info {
    font-family: 'Cinzel', serif;
    font-size: 13px;
    color: #fff;
    line-height: 18px;
}

/* ── "Already found" Message ── */
.qr-already-found {
    font-family: 'Uncial Antiqua', cursive;
    font-size: 16px;
}

/* ── Error Message ── */
.qr-error-msg {
    font-family: 'Uncial Antiqua', cursive;
    font-size: 16px;
}

/* ── No Scans Remaining ── */
.qr-no-scans {
    color: #fff;
    font-size: 13px;
}

/* ── Auto-Gen Form Card ── */
.qr-auto-gen-container {
    max-width: 600px;
    padding: 14px;
    border-radius: 15px;
    border: 1px solid #8b4513;
    background: rgba(0,0,0,0.5);
    margin: 0 auto;
}
.qr-auto-gen-container .form-group label {
    font-weight: bold;
    color: #ffca28;
}

/* ── Camera Button (file upload label) ── */
.qr-camera-btn {
    display: inline-block;
    background-size: 100%;
    background-repeat: no-repeat;
    height: 92px;
    width: 92px;
    cursor: pointer;
    overflow: hidden;
    text-decoration: none;
}
.qr-camera-btn > input[type=file] {
    display: none;
    overflow: hidden;
    width: 0;
    height: 0;
    cursor: pointer;
}

/* ── Camera Button (small, method 2) ── */
.qr-camera-btn-sm {
    display: inline-block;
    background-size: 100%;
    background-repeat: no-repeat;
    height: 3rem;
    width: 3rem;
    cursor: pointer;
    overflow: hidden;
    text-decoration: none;
}
.qr-camera-btn-sm > input[type=file] {
    display: none;
    overflow: hidden;
    width: 0;
    height: 0;
    cursor: pointer;
}

/* ── Submit Entry ── */
.qr-submit-entry {
    margin-top: 7px;
}

/* ── Manual Entry Input ── */
.qr-manual-input {
    font-family: 'Cinzel', serif;
    font-size: 13px;
    color: #fff;
    line-height: 18px;
    margin-top: 18px;
    margin-bottom: -2px;
    width: 250px;
}

/* ── Manual Web Address Textarea ── */
.qr-web-address-textarea {
    font-size: 10pt;
    background-color: #000;
    color: #fff;
    width: 95%;
    margin-top: -6px;
}

/* ── Generated QR Image ── */
.qr-generated-img {
    width: 30%;
    max-width: 110px;
    height: auto;
}

/* ── Shine Effect ── */
.qr-shine {
    background-repeat: no-repeat;
    border-radius: 5px;
    overflow: hidden;
    display: inline-block;
    height: 100%;
}
.qr-shine:after {
    content: "";
    position: fixed;
    top: -50%;
    left: -100%;
    width: 20%;
    height: 200%;
    opacity: 0;
    transform: rotate(30deg);
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0.13) 0%,
        rgba(255, 255, 255, 0.13) 77%,
        rgba(255, 255, 255, 0.5) 92%,
        rgba(255, 255, 255, 0.0) 100%
    );
}
.qr-shine:hover:after {
    opacity: 1;
    left: 100%;
    transition-property: left, top, opacity;
    transition-duration: 0.7s, 0.7s, 0.15s;
    transition-timing-function: ease;
}
.qr-shine:active:after {
    opacity: 0;
}

/* ── Fade-In ── */
.qr-fade-in {
    animation: qrFadeIn ease 9s;
}
@keyframes qrFadeIn {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}

/* ── Scanner Library Overrides ── */
#qr-reader {
    border: 2px solid #e99401 !important;
    border-radius: 10px;
    padding: 8px;
    margin: 0 auto;
    overflow: hidden;
}
#qr-reader__scan_region {
    display: none;
}
#qr-reader img[alt="Info icon"] {
    display: none;
}
#qr-reader video {
    border-radius: 10px;
}
#html5-qrcode-button-camera-start,
#html5-qrcode-button-camera-stop,
#html5-qrcode-button-camera-permission {
    margin-top: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    width: 180px;
    background-color: #3c2f2f;
    color: #efe0a0;
    font-family: 'Cinzel', serif;
    font-weight: 180;
    transform: skew(-15deg);
    border-color: #e99401;
}
