/**
 * Pingo Bingo - Game Demos Shared Styles
 */

:root {
    --demo-purple: #9C27B0;
    --demo-purple-dark: #7B1FA2;
    --demo-pink: #E91E63;
    --demo-gold: #FFD700;
    --demo-orange: #FFA500;
    --demo-green: #28a745;
    --demo-navy: #1E3A5F;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--demo-navy);
}

a {
    text-decoration: none;
}

.demo-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header / Toolbar */
.demo-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.demo-header .row {
    align-items: center;
}

.demo-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--demo-purple-dark);
}

.demo-subtitle {
    display: block;
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
    margin-top: 2px;
}

.demo-team-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--demo-purple), var(--demo-pink));
    color: #fff;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.demo-team-badge i {
    margin-right: 0.35rem;
}

/* Toolbar buttons */
.demo-toolbar {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.demo-btn {
    border: none;
    background: #6c757d;
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s ease, transform 0.15s ease;
}

.demo-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.demo-btn:active {
    transform: translateY(0);
}

.demo-btn.demo-btn-exit {
    background: #ffc107;
    color: #212529;
    width: auto;
    padding: 0 0.9rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.demo-btn.demo-btn-exit:hover {
    background: #e0a800;
}

/* Demo brand (header logo + wordmark) */
.demo-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    gap: 0.5rem;
}

.demo-brand:hover,
.demo-brand:focus {
    text-decoration: none;
}

.demo-brand-img {
    height: 80px;
    width: auto;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.12));
    transition: transform 0.3s ease;
}

.demo-brand:hover .demo-brand-img {
    transform: scale(1.05) rotate(2deg);
}

.demo-brand-text {
    display: block;
    font-size: 1.65rem;
    font-weight: 900;
    background: linear-gradient(90deg, #FFC107 0%, #4CAF50 20%, #E91E63 40%, #2196F3 60%, #9C27B0 80%, #FF6B35 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
    line-height: 1;
}

.demo-brand-tagline {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--demo-purple);
    letter-spacing: 0.3px;
    margin-top: 3px;
    text-transform: uppercase;
}

.demo-banner-desc {
    margin: 0.3rem 0 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1E3A5F;
    line-height: 1.35;
}

@media (max-width: 575px) {
    .demo-brand-img { height: 56px; }
    .demo-brand-text { font-size: 1.15rem; }
    .demo-brand-tagline { font-size: 0.65rem; }
    .demo-banner-desc { font-size: 0.8rem; }
}

/* Print button "doesn't work" treatment */
.demo-btn-print:hover,
.demo-btn-print.disabled-print {
    background: #dc3545;
}

.demo-btn-print:hover .bi-printer,
.demo-btn-print.disabled-print .bi-printer {
    display: none;
}

.demo-btn-print:hover::after,
.demo-btn-print.disabled-print::after {
    content: "\F622"; /* bi-slash-circle */
    font-family: "bootstrap-icons";
    font-size: 1.1rem;
}

/* Sound button "doesn't work" treatment (same as print) */
.demo-btn-sound:hover,
.demo-btn-sound.disabled-sound {
    background: #dc3545;
}

.demo-btn-sound:hover i,
.demo-btn-sound.disabled-sound i {
    display: none;
}

.demo-btn-sound:hover::after,
.demo-btn-sound.disabled-sound::after {
    content: "\F622"; /* bi-slash-circle */
    font-family: "bootstrap-icons";
    font-size: 1.1rem;
}

/* Main play area */
.demo-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 1.5rem 1rem 2rem 1rem;
}

.demo-banner {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 0.85rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 640px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.demo-banner-avatar {
    width: 110px;
    height: 110px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.15));
}

.demo-banner-text {
    flex: 1;
    text-align: left;
}

.demo-banner .demo-banner-title {
    margin: 0;
    font-weight: 700;
    color: var(--demo-purple-dark);
    font-size: 1.25rem;
}

.demo-banner .demo-banner-sub {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
    color: #555;
}

@media (max-width: 575px) {
    .demo-banner { gap: 0.75rem; padding: 0.75rem 1rem; }
    .demo-banner-avatar { width: 80px; height: 80px; }
    .demo-banner .demo-banner-title { font-size: 1.05rem; }
    .demo-banner .demo-banner-sub { font-size: 0.8rem; }
}

/* Game board */
.demo-board-wrapper {
    width: 100%;
    max-width: 600px;
    transition: all 0.3s ease;
    position: relative;
}

/* Watermark behind the board */
.demo-board-wrapper::after {
    content: 'pingo-bingo.com';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-35deg);
    font-size: clamp(2rem, 8vw, 6rem);
    font-weight: 800;
    color: rgba(255, 255, 255, 0.18);
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
    letter-spacing: 4px;
    text-transform: uppercase;
    user-select: none;
}

.demo-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 6px;
    aspect-ratio: 1 / 1;
    width: 100%;
    background-color: #dee2e6;
    padding: 6px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.demo-square {
    aspect-ratio: 1 / 1;
    background-color: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: all 0.2s ease;
    overflow: hidden;
    text-align: center;
}

.demo-square:hover:not(.free):not(.marked) {
    background-color: #f0f0f0;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.demo-square-label {
    font-size: clamp(0.85rem, 2.5vw, 1.4rem);
    font-weight: 600;
    color: #333;
    line-height: 1.15;
    transition: font-size 0.15s ease;
}

.demo-square.free {
    background: linear-gradient(135deg, var(--demo-gold), var(--demo-orange));
    cursor: default;
}

.demo-free-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.demo-penguin-avatar {
    width: 80%;
    height: auto;
    object-fit: contain;
    opacity: 0.4;
}

.demo-square.free .demo-free-label {
    position: absolute;
    font-size: clamp(1.1rem, 2.8vw, 1.6rem);
    font-weight: 900;
    color: var(--demo-purple);
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.9);
    letter-spacing: 0.05em;
    z-index: 1;
}

.demo-square.free:hover {
    transform: none;
    box-shadow: none;
}

.demo-square.marked {
    background-color: rgba(40, 167, 69, 0.55);
    border: 3px solid var(--demo-green);
}

.demo-square.marked .demo-square-label {
    color: #0d461a;
    font-weight: 700;
}

.demo-square-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--demo-green);
    font-size: 5rem;
    opacity: 0.35;
    pointer-events: none;
    animation: demoMarkPop 0.3s ease;
}

/* Pink heart marker for Pairs */
.demo-square-marker .bi-heart-fill {
    color: var(--demo-pink);
}

@keyframes demoMarkPop {
    0%   { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    60%  { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0.35; }
}

/* Fullscreen mode */
.demo-wrapper.fullscreen-active {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #f8f9fa;
}

.demo-wrapper.fullscreen-active .demo-header {
    display: none;
}

.demo-wrapper.fullscreen-active .demo-board-wrapper {
    max-width: none;
    width: min(100vmin, 100vh - 4rem);
}

.demo-exit-fullscreen {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 10001;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #6c757d;
    color: #fff;
    border: none;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.demo-wrapper.fullscreen-active .demo-exit-fullscreen {
    display: flex;
}

/* Demo notice */
.demo-notice {
    margin-top: 1rem;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    color: #555;
    text-align: center;
    max-width: 640px;
    width: 100%;
}

/* Win modal */
.demo-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10050;
}

.demo-modal-overlay.show {
    display: flex;
}

.demo-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 460px;
    width: calc(100% - 2rem);
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    animation: demoModalIn 0.25s ease;
}

@keyframes demoModalIn {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.demo-modal-header {
    background: var(--demo-green);
    color: #fff;
    padding: 1rem 1.25rem;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.demo-modal-body {
    padding: 1.5rem;
    text-align: center;
}

.demo-modal-body h3 {
    margin: 0.5rem 0;
    color: var(--demo-navy);
}

.demo-modal-body p {
    color: #555;
    margin-bottom: 0;
}

.demo-modal-footer {
    padding: 0.85rem 1.25rem;
    background: #f8f9fa;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.demo-modal-btn {
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
}

.demo-modal-btn.primary {
    background: var(--demo-purple);
    color: #fff;
}

.demo-modal-btn.primary:hover {
    background: var(--demo-purple-dark);
}

.demo-modal-btn.secondary {
    background: #6c757d;
    color: #fff;
}

/* Mobile tweaks */
@media (max-width: 575px) {
    .demo-title { font-size: 1rem; }
    .demo-team-badge { font-size: 0.75rem; padding: 0.3rem 0.7rem; }
    .demo-btn { width: 34px; height: 34px; font-size: 0.9rem; }
    .demo-btn.demo-btn-exit { padding: 0 0.7rem; font-size: 0.8rem; }
    .demo-banner .demo-banner-title { font-size: 1.05rem; }
}

/* ===== QUEST DEMO ===== */
.quest-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    max-width: 560px;
    width: 100%;
    margin-bottom: 1.25rem;
    text-align: center;
}

.quest-subject-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.quest-subject {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 900;
    background: linear-gradient(135deg, var(--demo-purple), var(--demo-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0.25rem 0 0.5rem;
    letter-spacing: 1px;
}

.quest-description {
    color: #555;
    margin: 0;
    font-size: 0.95rem;
}

.quest-progress-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--demo-navy);
    margin: 0.25rem 0 0.5rem;
}

.quest-progress-bar {
    background: #e9ecef;
    height: 18px;
    border-radius: 999px;
    overflow: hidden;
    margin: 0.25rem 0;
}

.quest-progress-fill {
    background: linear-gradient(90deg, var(--demo-green), #20c997);
    height: 100%;
    transition: width 0.4s ease;
    width: 0%;
}

.quest-action-row {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.btn-found {
    background: linear-gradient(135deg, var(--demo-green), #20c997);
    color: #fff;
    border: none;
    padding: 0.85rem 1.75rem;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-found:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(40, 167, 69, 0.5); }
.btn-found:active { transform: translateY(0); }
.btn-found:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-undo {
    background: #6c757d;
    color: #fff;
    border: none;
    padding: 0.85rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-undo:hover { background: #5a6268; }
.btn-undo:disabled { opacity: 0.5; cursor: not-allowed; }

/* Other teams */
.other-teams {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
    max-width: 560px;
    width: 100%;
}

.other-teams-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 0.75rem;
    text-align: center;
}

.other-team-row {
    margin-bottom: 0.85rem;
}

.other-team-row:last-child { margin-bottom: 0; }

.other-team-label {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    color: var(--demo-navy);
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
}

.other-team-bar {
    background: #e9ecef;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
}

.other-team-bar-fill {
    background: linear-gradient(90deg, #fd7e14, var(--demo-pink));
    height: 100%;
    border-radius: 999px;
}

/* ===== DASH DEMO ===== */
.dash-stats {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    width: 100%;
    max-width: 560px;
}

.dash-stat {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-align: center;
    flex: 1;
    min-width: 140px;
}

.dash-stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.dash-stat-value {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--demo-purple-dark);
    margin: 0.1rem 0 0;
}

.dash-pin-display {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 18px;
    padding: 2rem 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    text-align: center;
    max-width: 560px;
    width: 100%;
    margin-bottom: 1.25rem;
}

.dash-pin-instruction {
    font-size: 0.85rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.dash-pin-instruction-sub {
    font-size: 0.75rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0.25rem 0 1rem;
}

.dash-pin-subject {
    font-size: clamp(2rem, 7vw, 3.5rem);
    font-weight: 900;
    background: linear-gradient(135deg, var(--demo-purple), var(--demo-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    letter-spacing: 1px;
    transition: opacity 0.2s ease;
}

.dash-pin-subject.fading {
    opacity: 0;
}

.dash-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    max-width: 560px;
    margin-bottom: 1rem;
}

.btn-dash-found, .btn-dash-pass {
    flex: 1;
    min-width: 160px;
    border: none;
    padding: 0.95rem 1.5rem;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 1px;
    cursor: pointer;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s ease;
}

.btn-dash-found { background: linear-gradient(135deg, var(--demo-green), #20c997); }
.btn-dash-pass  { background: linear-gradient(135deg, #fd7e14, #dc3545); }

.btn-dash-found:hover, .btn-dash-pass:hover { transform: translateY(-2px); }
.btn-dash-found:disabled, .btn-dash-pass:disabled {
    opacity: 0.45; cursor: not-allowed; transform: none;
}

.dash-passes {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 0.5rem;
}

.dash-pass-box {
    width: 70px;
    height: 100px;
    border: 7px solid #ccc;
    border-radius: 8px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
}

.dash-pass-box i {
    font-size: 3.25rem;
    font-weight: 900;
    color: #ccc;
    transition: color 0.4s ease;
}

.dash-pass-box.used {
    border-color: #dc3545;
    animation: demoDashStrike 0.5s ease;
}

.dash-pass-box.used i {
    color: #dc3545;
}

@keyframes demoDashStrike {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.18); border-color: #ff6b7a; }
    100% { transform: scale(1); }
}

@media (max-width: 575px) {
    .dash-passes { gap: 0.85rem; }
    .dash-pass-box { width: 58px; height: 80px; border-width: 6px; }
    .dash-pass-box i { font-size: 2.5rem; }
}

/* Game-over & lose modal headers */
.demo-modal-header.lose { background: #dc3545; }
.demo-modal-header.info { background: var(--demo-purple); }
