/* ── Kataku Classroom & Smartboard Stylesheet ── */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    /* Fluid scale anchors for 1080p (1920px width) up to 4K */
    --sb-room-code-size:   clamp(4.5rem, 7.5vw, 10rem);
    --sb-clue-text-size:   clamp(1.75rem, 2.8vw, 4rem);
    --sb-label-size:       clamp(0.75rem, 1.1vw, 1.4rem);
    --sb-chat-text-size:   clamp(0.95rem, 1.4vw, 2rem);
    --sb-badge-size:       clamp(0.85rem, 1.2vw, 1.6rem);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    margin: 0;
    padding: 0;
}

/* ── 3D Candy Button Styles ── */
.btn-candy-blue {
    background-color: #2563EB;
    border-bottom: 4px solid #1D4ED8;
    transition: all 0.1s ease-in-out;
}
.btn-candy-blue:hover {
    background-color: #1D4ED8;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}
.btn-candy-blue:active {
    transform: translateY(2px);
    border-bottom-width: 1px;
}

.btn-candy-green {
    background-color: #22C55E;
    border-bottom: 4px solid #16A34A;
    transition: all 0.1s ease-in-out;
}
.btn-candy-green:hover {
    background-color: #16A34A;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.35);
}
.btn-candy-green:active {
    transform: translateY(2px);
    border-bottom-width: 1px;
}

.btn-candy-gold {
    background-color: #EAB308;
    border-bottom: 4px solid #CA8A04;
    transition: all 0.1s ease-in-out;
}
.btn-candy-gold:hover {
    background-color: #CA8A04;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(234, 179, 8, 0.35);
}
.btn-candy-gold:active {
    transform: translateY(2px);
    border-bottom-width: 1px;
}

.btn-candy-red {
    background-color: #EF4444;
    border-bottom: 4px solid #B91C1C;
    transition: all 0.1s ease-in-out;
}
.btn-candy-red:hover {
    background-color: #DC2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
}
.btn-candy-red:active {
    transform: translateY(2px);
    border-bottom-width: 1px;
}

/* ── Dropzone & Upload Styles ── */
.dropzone-idle {
    border: 2px dashed #BAE6FD;
    background-color: #F0F9FF;
    border-radius: 1rem;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.dropzone-idle:hover {
    border-color: #38BDF8;
    background-color: #E0F2FE;
}
.dropzone-hover {
    border: 2px dashed #0284C7;
    background-color: #BAE6FD;
    border-radius: 1rem;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: copy;
    transform: scale(1.01);
}

/* ── Smartboard Grid & Viewport (Projector) ── */
.smartboard-viewport {
    width: 100vw;
    height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
    position: relative;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: #FFFFFF;
    background: #0A1628;
}

.sb-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(0.5rem, 1vw, 1.25rem) clamp(1rem, 2vw, 3rem);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
}

.sb-topic-title {
    font-size: clamp(1rem, 1.6vw, 2.2rem);
    color: #BAE6FD;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 45vw;
}

.sb-badge {
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: var(--sb-badge-size);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.sb-student-badge {
    background: rgba(56, 189, 248, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #7DD3FC;
}
.sb-host-badge {
    background: rgba(250, 204, 21, 0.2);
    border: 1px solid rgba(250, 204, 21, 0.4);
    color: #FDE047;
}

.sb-fullscreen-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    border-radius: 0.5rem;
    padding: 0.35rem 0.65rem;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.2s;
}
.sb-fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sb-main-grid {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: clamp(1rem, 2vw, 3rem);
    padding: clamp(1rem, 2vw, 2.5rem);
    overflow: hidden;
    height: 100%;
}

.sb-left-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.sb-hero-row {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 2vw, 2.5rem);
}

.sb-room-code-section {
    flex: 1;
}

.sb-label {
    font-size: var(--sb-label-size);
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.sb-room-code {
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: var(--sb-room-code-size);
    font-weight: 700;
    color: #FACC15;
    letter-spacing: 0.08em;
    line-height: 1;
    text-shadow: 0 4px 24px rgba(250, 204, 21, 0.4);
}

.sb-sublabel {
    font-size: clamp(0.75rem, 1vw, 1.25rem);
    color: #94A3B8;
    margin-top: 0.35rem;
}

.sb-qr-box {
    background: #FFFFFF;
    padding: clamp(0.5rem, 1vw, 1rem);
    border-radius: 1.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sb-clue-card {
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: clamp(1rem, 2vw, 2rem);
    padding: clamp(1rem, 2vw, 2.25rem);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    margin-top: auto;
}

.sb-clue-label {
    font-size: var(--sb-label-size);
    color: #38BDF8;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sb-clue-text {
    font-size: var(--sb-clue-text-size);
    color: #FFFFFF;
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
}

.sb-badge-green {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #4ADE80;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: var(--sb-badge-size);
    font-weight: 700;
}

/* ── Live Chat Feed Panel ── */
.sb-chat-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: clamp(1rem, 2vw, 2rem);
    padding: clamp(0.75rem, 1.5vw, 1.5rem);
}

.sb-chat-header {
    font-size: clamp(0.9rem, 1.3vw, 1.75rem);
    font-weight: 700;
    color: #BAE6FD;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sb-chat-feed {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.sb-chat-feed::-webkit-scrollbar {
    display: none;
}

.sb-chat-empty {
    margin: auto;
    text-align: center;
    color: #64748B;
    font-size: clamp(0.9rem, 1.3vw, 1.6rem);
}

.sb-chat-bubble {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: clamp(0.5rem, 1vw, 1.25rem);
    padding: clamp(0.4rem, 0.8vw, 1rem) clamp(0.6rem, 1.2vw, 1.5rem);
    font-size: var(--sb-chat-text-size);
    color: #E2E8F0;
    animation: bubbleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bubble-name {
    font-size: 0.75em;
    color: #38BDF8;
    font-weight: 800;
    display: block;
    margin-bottom: 0.15rem;
}

@keyframes bubbleIn {
    from { opacity: 0; transform: translateY(12px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Progress Bar & Timer ── */
.sb-progressbar-area {
    padding: clamp(0.5rem, 1vw, 1.25rem) clamp(1rem, 2vw, 3rem);
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sb-progressbar-track {
    width: 100%;
    height: clamp(8px, 1vw, 18px);
    background: rgba(255, 255, 255, 0.12);
    border-radius: 9999px;
    overflow: hidden;
}

.sb-progressbar-fill {
    height: 100%;
    background: linear-gradient(90deg, #38BDF8, #22C55E);
    border-radius: 9999px;
    width: 100%;
    transition: width 0.25s linear;
}

.sb-progressbar-fill.urgent {
    background: linear-gradient(90deg, #F97316, #EF4444);
    animation: urgencyPulse 0.5s ease-in-out infinite alternate;
}

@keyframes urgencyPulse {
    from { opacity: 0.75; transform: scaleY(0.95); }
    to   { opacity: 1; transform: scaleY(1.05); }
}

.sb-progressbar-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.35rem;
    font-size: var(--sb-label-size);
    font-weight: 700;
    color: #94A3B8;
}

/* ── Overlays: Solved Word & Bingo ── */
.sb-solved-banner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 100;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.sb-solved-inner {
    background: rgba(22, 163, 74, 0.95);
    border: 3px solid #4ADE80;
    border-radius: clamp(1rem, 2vw, 3rem);
    padding: clamp(1.5rem, 3vw, 4rem) clamp(2rem, 5vw, 6rem);
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: solvedPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sb-solved-word {
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: clamp(3rem, 6.5vw, 8.5rem);
    color: #FFFFFF;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.sb-solved-by {
    font-size: clamp(1rem, 1.8vw, 2.5rem);
    color: #DCFCE7;
    margin-top: 0.5rem;
    font-weight: 600;
}

@keyframes solvedPop {
    from { transform: scale(0.4); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.sb-bingo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 13, 26, 0.85);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: fadeIn 0.3s ease;
}

.sb-bingo-content {
    text-align: center;
    z-index: 10;
}

.sb-bingo-text {
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: clamp(4rem, 10vw, 13rem);
    color: #FACC15;
    font-weight: 700;
    text-shadow: 0 8px 40px rgba(250, 204, 21, 0.6);
    animation: bingoBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sb-bingo-player {
    font-size: clamp(1.5rem, 3vw, 4rem);
    color: #FFFFFF;
    font-weight: 700;
    margin-top: 1rem;
}

@keyframes bingoBounce {
    0%   { transform: scale(0.2); }
    60%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.confetti-dot {
    position: absolute;
    border-radius: 50%;
    animation: confettiFall 2.5s ease-in-out infinite;
}

@keyframes confettiFall {
    0%   { transform: translateY(-50px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ── Standby Screen Styles ── */
.standby-screen {
    position: absolute;
    inset: 0;
    background: #050D1A;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    text-align: center;
}

.standby-headline {
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: clamp(2.5rem, 5vw, 6.5rem);
    color: #FFFFFF;
    font-weight: 700;
}

.standby-subtext {
    font-size: clamp(1.25rem, 2.2vw, 3rem);
    color: #94A3B8;
}

.sb-logo-pulse {
    animation: logoPulse 2.5s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px rgba(56, 189, 248, 0.3)); }
    50%      { transform: scale(1.08); filter: drop-shadow(0 0 35px rgba(56, 189, 248, 0.6)); }
}

/* ── Connection Status Dot ── */
.ws-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}
.ws-green {
    background-color: #22C55E;
    box-shadow: 0 0 8px #22C55E;
}
.ws-yellow {
    background-color: #EAB308;
    box-shadow: 0 0 8px #EAB308;
}
.ws-red {
    background-color: #EF4444;
    box-shadow: 0 0 8px #EF4444;
}
.ws-pulse {
    animation: statusPulse 1.2s infinite;
}
@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.85); }
}

/* ── Summary Screen & Word Cloud ── */
.summary-stat {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1.25rem;
    padding: clamp(1rem, 2vw, 2rem);
    min-width: clamp(120px, 15vw, 220px);
}

.stat-number {
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: clamp(2.5rem, 4vw, 5.5rem);
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: clamp(0.75rem, 1vw, 1.25rem);
    color: #94A3B8;
    font-weight: 600;
    margin-top: 0.35rem;
}

.summary-word-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    max-height: 35vh;
    overflow-y: auto;
}

.summary-word-tag {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #86EFAC;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: clamp(0.9rem, 1.3vw, 1.8rem);
    font-weight: 700;
}

@keyframes fadeIn {
    from { opacity: 0; } to { opacity: 1; }
}

