@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;800&display=swap');

:root {
    --bg: #f2f2f2;
    --primary: #46178f;
    --red: #e21b3c;
    --blue: #1368ce;
    --yellow: #d89e00;
    --green: #26890c;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg);
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.bg-purple {
    background-color: var(--primary);
    background-image: linear-gradient(135deg, #46178f 0%, #2e0e5e 100%);
    color: var(--white);
    justify-content: center;
    align-items: center;
}

.join-container {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.join-container h1 {
    color: var(--primary);
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 800;
}

input {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #ccc;
    border-radius: 6px;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--primary);
    outline: none;
}

.btn {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    font-weight: 800;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.1s, filter 0.2s;
}

.btn:active {
    transform: scale(0.98);
}

.btn:hover {
    filter: brightness(1.1);
}

.btn-black {
    background: #333;
    color: #fff;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-red {
    background: var(--red);
    color: #fff;
}

.btn-blue {
    background: var(--blue);
    color: #fff;
}

.btn-yellow {
    background: var(--yellow);
    color: #fff;
}

.btn-green {
    background: var(--green);
    color: #fff;
}

/* Grid for options */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 15px;
    flex: 1;
    padding: 15px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.answer-btn {
    border-radius: 8px;
    border: none;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--white);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
}

.answer-btn:active {
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    transform: translateY(3px);
}

.answer-0 {
    background-color: var(--red);
}

.answer-1 {
    background-color: var(--blue);
}

.answer-2 {
    background-color: var(--yellow);
}

.answer-3 {
    background-color: var(--green);
}


/* Host styles */
.host-header {
    background: #fff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.pin-display {
    font-size: 1.5rem;
    font-weight: 800;
}

.pin-display span {
    font-size: 2.5rem;
    margin-left: 10px;
}

.question-text {
    font-size: 3rem;
    text-align: center;
    margin: 40px 20px;
    font-weight: 800;
}

.players-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px;
    justify-content: center;
}

.player-chip {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.2rem;
    color: #fff;
    animation: popIn 0.3s ease-out forwards;
}

@keyframes popIn {
    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}

.host-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 20px;
    max-width: 1000px;
    margin: auto;
}

.host-option {
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: stretch;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.host-option .color-bar {
    width: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 2rem;
}

/* For player screen to properly take up vertical space */
.options-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
}

.host-option .text {
    flex: 1;
    padding: 20px;
    font-size: 1.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

/* Control buttons for Admin */
.controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.controls button {
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 800;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.timer {
    font-size: 3rem;
    font-weight: 800;
    text-align: center;
    margin: 20px;
    color: var(--primary);
}

.leaderboard {
    max-width: 600px;
    margin: 40px auto;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.leaderboard-row {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 2px solid #eee;
    font-size: 1.5rem;
    font-weight: 600;
}

.leaderboard-row:nth-child(1) {
    background: #fdf0d5;
}

.leaderboard-row:nth-child(2) {
    background: #ecf0f1;
}

.leaderboard-row:nth-child(3) {
    background: #fae5d3;
}

/* Status messages */
.status-msg {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    margin-top: 50vh;
    transform: translateY(-50%);
}

/* Waiting state */
.waiting-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
}
 / *   T E T R I S   U I   A D D I T I O N S   * / 
 . l e a d e r b o a r d - g r i d   { 
         d i s p l a y :   g r i d ; 
         g r i d - t e m p l a t e - c o l u m n s :   r e p e a t ( a u t o - f i t ,   m i n m a x ( 2 0 0 p x ,   1 f r ) ) ; 
         g a p :   2 0 p x ; 
         f l e x :   1 ; 
         o v e r f l o w - y :   a u t o ; 
         p a d d i n g :   1 0 p x ; 
         w i d t h :   1 0 0 % ; 
 } 
 . p l a y e r - c a r d   { 
         b a c k g r o u n d :   # 2 2 2 ; 
         b o r d e r :   3 p x   s o l i d   # 4 4 4 ; 
         b o r d e r - r a d i u s :   8 p x ; 
         p a d d i n g :   1 5 p x ; 
         t e x t - a l i g n :   c e n t e r ; 
         p o s i t i o n :   r e l a t i v e ; 
         t r a n s i t i o n :   a l l   0 . 3 s ; 
         c o l o r :   w h i t e ; 
 } 
 . p l a y e r - c a r d . a c t i v e   {   b o r d e r - c o l o r :   v a r ( - - c y a n ,   # 0 0 f f f f ) ;   } 
 . p l a y e r - c a r d . g a m e o v e r   {   b o r d e r - c o l o r :   v a r ( - - r e d ,   # f f 3 3 3 3 ) ;   o p a c i t y :   0 . 6 ;   } 
 . p l a y e r - n a m e   {   f o n t - s i z e :   1 . 2 r e m ;   c o l o r :   v a r ( - - y e l l o w ,   # f f f f 0 0 ) ;   m a r g i n - b o t t o m :   1 5 p x ;   w h i t e - s p a c e :   n o w r a p ;   o v e r f l o w :   h i d d e n ;   t e x t - o v e r f l o w :   e l l i p s i s ;   } 
 . p l a y e r - s c o r e   {   f o n t - s i z e :   2 r e m ;   c o l o r :   # f f f ;   } 
 . p l a y e r - s t a t u s   {   p o s i t i o n :   a b s o l u t e ;   b o t t o m :   - 1 0 p x ;   l e f t :   5 0 % ;   t r a n s f o r m :   t r a n s l a t e X ( - 5 0 % ) ;   b a c k g r o u n d :   v a r ( - - r e d ,   # f f 3 3 3 3 ) ;   p a d d i n g :   5 p x   1 0 p x ;   f o n t - s i z e :   0 . 7 r e m ;   b o r d e r - r a d i u s :   4 p x ;   d i s p l a y :   n o n e ;   } 
 . p l a y e r - c a r d . g a m e o v e r   . p l a y e r - s t a t u s   {   d i s p l a y :   b l o c k ;   } 
 . g a m e - c o n t a i n e r   {   d i s p l a y :   f l e x ;   f l e x - d i r e c t i o n :   c o l u m n ;   a l i g n - i t e m s :   c e n t e r ;   g a p :   1 0 p x ;   } 
 c a n v a s   {   b o r d e r :   4 p x   s o l i d   # f f f ;   b a c k g r o u n d :   # 0 0 0 ;   m a x - w i d t h :   1 0 0 % ;   } 
 . m o b i l e - c o n t r o l s   {   d i s p l a y :   g r i d ;   g r i d - t e m p l a t e - c o l u m n s :   1 f r   1 f r   1 f r ;   g r i d - t e m p l a t e - r o w s :   1 f r   1 f r ;   g a p :   1 0 p x ;   m a r g i n - t o p :   2 0 p x ;   w i d t h :   3 0 0 p x ;   } 
 . p a d - b t n   {   b a c k g r o u n d :   # 3 3 3 ;   c o l o r :   # f f f ;   b o r d e r :   n o n e ;   b o r d e r - r a d i u s :   8 p x ;   f o n t - s i z e :   1 . 5 r e m ;   p a d d i n g :   2 0 p x ;   c u r s o r :   p o i n t e r ;   u s e r - s e l e c t :   n o n e ;   t o u c h - a c t i o n :   m a n i p u l a t i o n ;   } 
 . p a d - b t n : a c t i v e   {   b a c k g r o u n d :   # 5 5 5 ;   } 
 . b t n - u p   {   g r i d - c o l u m n :   2 ;   g r i d - r o w :   1 ;   } 
 . b t n - l e f t   {   g r i d - c o l u m n :   1 ;   g r i d - r o w :   2 ;   } 
 . b t n - r i g h t   {   g r i d - c o l u m n :   3 ;   g r i d - r o w :   2 ;   } 
 . b t n - d o w n   {   g r i d - c o l u m n :   2 ;   g r i d - r o w :   2 ;   } 
 . b t n - d r o p   {   g r i d - c o l u m n :   1   /   s p a n   3 ;   g r i d - r o w :   3 ;   p a d d i n g :   1 5 p x ;   b a c k g r o u n d :   v a r ( - - c y a n ,   # 0 0 f f f f ) ;   c o l o r :   # 0 0 0 ;   f o n t - s i z e :   1 r e m ;   } 
 . s c o r e - d i s p l a y   {   f o n t - s i z e :   1 . 5 r e m ;   c o l o r :   v a r ( - - y e l l o w ,   # f f f f 0 0 ) ;   m a r g i n - b o t t o m :   1 0 p x ;   } 
 . g a m e - o v e r - o v e r l a y   {   p o s i t i o n :   a b s o l u t e ;   t o p :   0 ;   l e f t :   0 ;   r i g h t :   0 ;   b o t t o m :   0 ;   b a c k g r o u n d :   r g b a ( 0 , 0 , 0 , 0 . 8 ) ;   d i s p l a y :   f l e x ;   f l e x - d i r e c t i o n :   c o l u m n ;   a l i g n - i t e m s :   c e n t e r ;   j u s t i f y - c o n t e n t :   c e n t e r ;   z - i n d e x :   1 0 ;   } 
  
 