/* /viewer/viewer.css — shareable by every mini-game */
:root{
  /* brand colors from existing main.css */
  --c-header-bg:  #FFE4B5;   /* moccasin   */
  --c-footer-bg:  #ADD8E6;   /* lightblue  */
  --c-accent:     #8A2BE2;   /* blueviolet */
  --c-accent-2:   #9932CC;   /* darkorchid */
  --c-btn-bg:     #FFB6C1;   /* lightpink  */
  --c-link:       #000080;   /* navy       */
  --c-brand:      purple;

  --gap: clamp(.5rem,3vw,1rem);
  --radius: .6rem;
  --font-body: system-ui, sans-serif;
  --font-size: clamp(1rem, 2.4vw, 1.25rem);
}

*{box-sizing:border-box;margin:0;padding:0}

body{
  font: var(--font-size)/1.4 var(--font-body);
  min-height: 100vh;      /* fallback so older editors & engines are happy */
  display:flex;
  flex-direction:column;
}

@supports (min-height: 100svh){
  body{ min-height: 100svh; }    /* real height on browsers that know svh */
}




header, footer{
  text-align:center;
  padding:.6rem 1rem;
  font-weight:600;
}

header{background:var(--c-header-bg);}
footer{background:var(--c-footer-bg);font-size:.9em;}

main{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items: center;      /* horizontal centring */
  justify-content: center;  /* vertical   centring */
  gap:var(--gap);
  padding:var(--gap);
}



/* ------------------------------------------------------------------
   Map your legacy IDs/classes onto the new brand tokens
------------------------------------------------------------------ */


.brand{
  color: var(--c-brand, purple);
  font-weight: 600;
}



#smallheader, #header{
  background: var(--c-header-bg);
  text-align: center;
  padding: .6rem 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}

#smallfooter, #footer{
  background: var(--c-footer-bg);
  text-align: center;
  font-size: .9em;
  padding: .5rem 1rem;
}

#sheadertext{
  width:100%;
  display:flex;
  justify-content: space-between;
  align-items:center;
  flex-wrap: wrap;
  gap:.5rem;
}

#sheadertext h2{
  margin:0;
  padding:0;
  font-size: clamp(1rem, 4vw, 1.25rem);
}

#sheadertext .title{
  flex: 1 1 auto;
  text-align:center;
}

#sheadertext .spacer{
  color: transparent;   /* keeps layout when “hello” hidden */
  visibility: hidden;
}

#sheadertext .hello{
  white-space: nowrap;
}

/* optional: links & version text inherit brand colors */
a{color:var(--c-link);}
span.version{color:var(--c-accent-2);}







/* --- lobby form touch-ups --------------------------------------- */

/* let the input look like the branded buttons */
#frmJoin input[type="text"]{
  font: inherit;
  padding: .55rem .8rem;          /* same vertical padding as .btn */
  border: 2px solid var(--c-accent);
  border-radius: var(--radius);
  text-align: center;
  text-transform: uppercase;
  width: 10ch;        /* spacious enough for 4 wide letters like ‘M’ */
  min-width: 120px;   /* keeps it readable on very narrow phones    */
}

/* align input + button nicely and add space under the heading */
#join-form form{
  display: flex;
  gap: .5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--gap);         /* extra space below “Enter Room Code” */
}

#roster{
    margin-bottom: var(--gap);    /* space before the Ready button   */
    margin-top: var(--gap);       /* space under the Room Code Header */
    list-style:none;              /* drop the default bullet */
    padding:0;
}

#roster li{
    display:flex;
    align-items:center;
    gap:.4rem;
}

#roster li .status{
    display:inline-block;
    width:1.2em;              /* enough for ✅ but not too wide */
    text-align:center;
}


#lobby{
    text-align:center;
    width: 22rem;          /* wide enough for the long message        */
    max-width: 90vw;       /* but never exceed the viewport on phones */
}

#waitingMsg{
    margin-top: var(--gap);
    min-height: 1.4em;         /* reserves a line, so vertical height stays constant */
}



/* Live-play tip shown under the header on game screens */
#liveNotice{
  max-width: 42rem;
  margin: .25rem auto var(--gap);
  padding: .5rem .75rem;
  text-align: center;
  background: var(--c-footer-bg);
  border: 1px solid var(--c-accent);
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
}




/* ------------------------------------------------------------------
   Brand-wide button class
------------------------------------------------------------------ */
.btn{
    font: inherit;
    padding: .55rem 1rem;
    background: var(--c-btn-bg);
    border: 2px solid var(--c-accent);
    border-radius: var(--radius);
    cursor: pointer;
    text-align: center;
    color: var(--c-accent);
    text-decoration: none;     /* keeps <a class="btn"> clean */
    display: inline-block;     /* works for both <a> and <button> */
}

.btn:disabled{
    opacity: .35;
    cursor: default;
}
