/* TITLE (title.js) */
#title
{
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6vh;
    padding: 16px;
    background: #000 radial-gradient(ellipse at center, #1a2a2c 0%, #000 70%);
    color: #e9e9ed;
    font-family: Courier, monospace;
    text-align: center;
    z-index: 5;
}
#title h1
{
    margin: 0;
    font-size: clamp(28px, 7vw, 72px);
    font-weight: normal;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}
.title_options{ display: flex; flex-direction: column; gap: 16px; }
.title_btn
{
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 240px;
    padding: 12px 24px;
    border: 1px solid #618d90;
    border-radius: 10px;
    background-color: rgba(97, 141, 144, 0.15);
    color: inherit;
    font: inherit;
    font-size: 18px;
}
.title_btn:hover{ background-color: rgba(97, 141, 144, 0.4); }
.title_btn small{ opacity: 0.6; font-size: 12px; }
.title_langs{ display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.title_lang
{
    padding: 6px 14px;
    border: 1px solid transparent;
    border-radius: 16px;
    background: none;
    color: inherit;
    font: inherit;
    font-size: 15px;
    opacity: 0.6;
}
.title_lang:hover{ opacity: 1; }
.title_music
{
    padding: 6px 14px;
    border: 1px solid #618d90;
    border-radius: 16px;
    background: none;
    color: inherit;
    font: inherit;
    font-size: 15px;
    opacity: 0.6;
}
.title_music.on{ background-color: rgba(97, 141, 144, 0.25); opacity: 1; }
.title_lang.on{ border-color: #618d90; background-color: rgba(97, 141, 144, 0.25); opacity: 1; }

/* CUT SCENES AND TRANSITIONS (cinema.js): a click skips */
#cinema
{
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
    cursor: pointer;
    z-index: 3;
}
#cinema video{ width: 100%; height: 100%; object-fit: contain; }

/* THE INVESTIGATION BOARD (board.js) */
#board
{
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    background-color: #2b1d12;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 6px 6px;
    color: #f2e8d5;
    font-family: Courier, monospace;
    z-index: 1;
}
.board_head
{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
}
.board_head h2{ margin: 0; font-size: 20px; font-weight: normal; }
.board_tabs{ display: flex; gap: 8px; }
.board_tab
{
    position: relative;
    padding: 6px 14px;
    border: 1px solid rgba(242, 232, 213, 0.4);
    border-radius: 6px;
    background: none;
    color: inherit;
    font: inherit;
    font-size: 15px;
}
.board_tab.on{ background-color: #f2e8d5; color: #2b1d12; }
#board_close
{
    width: 48px;
    height: 48px;
    background: url('../img/accessories/white_cross.gif') center / contain no-repeat;
    cursor: pointer;
}
.board_wall
{
    position: relative;
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: center;
    gap: 28px;
    padding: 16px;
    overflow: auto;
}
.board_threads
{
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.board_threads line{ stroke: #c0392b; stroke-width: 3; stroke-linecap: round; }
.board_card
{
    position: relative;   /* above the threads */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 110px;
    padding: 8px;
    border: none;
    background-color: #f2e8d5;
    box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.5);
    color: #222;
    font: inherit;
    font-size: 12px;
}
.board_card:nth-child(odd){ transform: rotate(-2deg); }
.board_card:nth-child(even){ transform: rotate(1.5deg); }
.board_card img{ width: 94px; height: 94px; object-fit: cover; }
.board_card.selected{ outline: 3px solid #00b6c8; }
.board_links
{
    max-height: 30vh;
    margin: 0;
    padding: 8px 16px 8px 32px;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.35);
    font-size: 13px;
}
.board_links:empty{ display: none; }
.board_links p{ margin: 2px 0 8px; }

/* THE NOTES: one column per town, post-its pinned in it */
.board_notes
{
    flex: 1;
    display: flex;
    gap: 24px;
    padding: 8px 16px 16px;
    overflow: auto;
}
.board_empty{ margin: auto; opacity: 0.7; }
.board_section
{
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1 0 220px;
    max-width: 340px;
}
.board_section_head
{
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(242, 232, 213, 0.3);
}
.board_section_head h3{ margin: 0; font-size: 17px; font-weight: normal; letter-spacing: 0.05em; }
.postit
{
    position: relative;
    display: block;
    box-sizing: border-box;
    padding: 10px 12px;
    border: none;
    background-color: #f7e67c;
    box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.5);
    color: #222;
    font: inherit;
    font-size: 14px;
    text-align: left;
}
.postit:nth-child(odd){ transform: rotate(-1deg); }
.postit:nth-child(even){ transform: rotate(0.8deg); }
.postit p{ margin: 0 0 4px; }
.postit p:last-child{ margin-bottom: 0; }
.postit p.done{ text-decoration: line-through; opacity: 0.6; }
.postit.new{ outline: 3px solid #00b6c8; }
/* the player's own: another colour, written as typed */
.postit.mine{ width: 100%; background-color: #a8d8e0; white-space: pre-wrap; overflow-wrap: anywhere; cursor: pointer; }
.postit.mine.editing{ transform: none; cursor: default; }
.board_write
{
    width: 100%;
    box-sizing: border-box;
    border: none;
    background: rgba(255, 255, 255, 0.5);
    color: #222;
    font: inherit;
    resize: vertical;
}
.postit_tools{ display: flex; justify-content: space-between; margin-top: 6px; }
.postit_tools button
{
    padding: 4px 12px;
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.5);
    font: inherit;
}

@media (max-height: 500px)
{
    .board_card{ width: 76px; padding: 4px; font-size: 10px; }
    .board_card img{ width: 64px; height: 64px; }
    .board_wall{ gap: 16px; }
}

/* THE END, AND THE CREDITS (ending.js) */
#ending
{
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4vh;
    padding: 16px;
    overflow: auto;
    background: #000 radial-gradient(ellipse at center, #1a2a2c 0%, #000 70%);
    color: #e9e9ed;
    font-family: Courier, monospace;
    text-align: center;
    z-index: 5;
}
#ending h1
{
    margin: 0;
    font-size: clamp(24px, 5vw, 56px);
    font-weight: normal;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}
.ending_text{ max-width: 640px; font-size: 18px; }
.ending_credits h2{ margin: 0 0 8px; font-size: 16px; font-weight: normal; opacity: 0.7; }
.ending_credits ul{ list-style: none; margin: 0; padding: 0; font-size: 14px; }
.ending_credits li{ margin: 6px 0; }
.ending_credits a{ display: block; color: #8fc3c6; font-size: 12px; word-break: break-all; }
.title_credits
{
    border: none;
    background: none;
    color: inherit;
    font: inherit;
    font-size: 14px;
    opacity: 0.6;
    text-decoration: underline;
}
.title_credits:hover{ opacity: 1; }

/* ROUND BUTTONS: save, load, full screen, quit, and the « ? » of how to play */
.round-btn
{
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid #618d90;
    border-radius: 50%;
    background-color: rgba(97, 141, 144, 0.15);
    color: #e9e9ed;
    font-family: Courier, monospace;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
}
.round-btn:hover{ background-color: rgba(97, 141, 144, 0.5); }

/* HOW TO PLAY (help.js), from the title screen and from the drawer */
.title_help
{
    position: absolute;
    right: 16px;
    top: 16px;
    width: 40px;
    height: 40px;
    font-size: 22px;
}
#help
{
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    padding: 16px;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.92);
    color: #e9e9ed;
    font-family: Courier, monospace;
    z-index: 6;
}
.help_box
{
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 680px;
    margin: auto 0;
}
#help h1{ margin: 0 0 8px; font-size: 26px; font-weight: normal; letter-spacing: 0.2em; text-transform: uppercase; }
.help_text{ font-size: 15px; line-height: 1.45; }
.help_text h3{ margin: 18px 0 6px; color: #8fc3c6; font-size: 16px; }
.help_text p{ margin: 6px 0; }
.help_text ul{ margin: 6px 0; padding-left: 0; list-style: none; }
.help_text li{ margin: 6px 0; }
.help_text img{ height: 22px; vertical-align: middle; }
.help_text img[src$=".svg"]{ height: 16px; filter: invert(1); }   /* drawn in black */
.help_close{ margin-top: 20px; }

/* THE NOTES IN A SMALL WINDOW (notes_float.js), over the place, the object view, the devices */
#notes-btn
{
    position: fixed;
    left: 8px;
    bottom: 8px;
    width: 44px;
    height: 44px;
    font-size: 22px;
    z-index: 4;
}
#notes_float
{
    position: fixed;
    left: 60px;
    bottom: 8px;
    display: flex;
    flex-direction: column;
    width: min(300px, calc(100vw - 76px));
    max-height: min(60vh, 420px);
    max-height: min(60dvh, 420px);
    background-color: rgba(43, 29, 18, 0.92);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    color: #f2e8d5;
    font-family: Courier, monospace;
    z-index: 4;
}
.notes_float_head
{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px 6px 12px;
    border-bottom: 1px solid rgba(242, 232, 213, 0.3);
    cursor: move;
    touch-action: none;
    user-select: none;
}
.notes_float_close{ border: none; background: none; color: inherit; font-size: 18px; cursor: pointer; }
.notes_float_body
{
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 12px;
    overflow: auto;
    user-select: text;
}
.notes_float_body h3{ margin: 6px 0 0; font-size: 14px; font-weight: normal; letter-spacing: 0.05em; }
.notes_float_body .postit{ transform: none; font-size: 13px; }
.notes_float_body .postit.mine{ resize: vertical; cursor: text; }
.notes_float_empty{ opacity: 0.7; }
.notes_float_add
{
    margin: 0 12px 10px;
    padding: 4px;
    border: 1px dashed rgba(242, 232, 213, 0.5);
    border-radius: 5px;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}
/* not over a film, nor over the board that shows the same */
#app:has(#cinema) #notes-btn, #app:has(#cinema) #notes_float,
#app:has(#board) #notes-btn, #app:has(#board) #notes_float{ display: none; }
