@font-face {
    font-family: 'Gluten';
    src: url('fonts/Gluten-Regular.ttf') format('truetype'), /* TTF file */
         url('fonts/Gluten-Regular.woff') format('woff'); /* WOFF file */
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'HoltwoodOneSC';
    src: url('fonts/HoltwoodOneSC-Regular.ttf') format('truetype'),
         url('fonts/HoltwoodOneSC-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'LilitaOne';
    src: url('fonts/LilitaOne-Regular.ttf') format('truetype'),
         url('fonts/LilitaOne-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'LuckiestGuy';
    src: url('fonts/LuckiestGuy-Regular.ttf') format('truetype'),
         url('fonts/LuckiestGuy-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'Righteous';
    src: url('fonts/Righteous-Regular.ttf') format('truetype'),
         url('fonts/Righteous-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'Quicksand';
    src: url('fonts/Quicksand-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
}
@font-face {
    font-family: 'NotoSans';
    src: url('fonts/NotoSans-Medium.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: 'NotoSansSC';
    src: url('fonts/NotoSansSC-Medium.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: 'NotoSansJP';
    src: url('fonts/NotoSansJP-Medium.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: 'Quicksand';
    src: url('fonts/Quicksand-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: 'Quicksand';
    src: url('fonts/Quicksand-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}
@font-face {
    font-family: 'Playfair Display';
    src: url('fonts/PlayfairDisplay-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: 'Playfair Display';
    src: url('fonts/PlayfairDisplay-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
}
@font-face {
    font-family: 'Playfair Display';
    src: url('fonts/PlayfairDisplay-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}
@font-face {
    font-family: 'Playfair Display';
    src: url('fonts/PlayfairDisplay-SemiBoldItalic.ttf') format('truetype');
    font-weight: 600;
    font-style: italic;
}


body {
    /* padding-top: env(safe-area-inset-top); */

    font-family: "Gluten", 'NotoSansJP', 'NotoSansSC', sans-serif;
    font-size: x-large;
    color: rgb(255, 255, 255);
    background-color: #012c1382;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100svh; /* Respect the actual visible viewport height */
    height: 100vh;  /* Fallback for older browsers */
    margin: 0;

    margin-top: 20px; /* Arbitrary, just a test */
    overflow: hidden;
}

body.story-mode-active {
    cursor: none; /* Hide cursor in story mode */
    overflow: hidden; /* Prevent scrolling in story mode */
}

body.story-mode-active .story-content {
    height: 100vh;
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
}

body.story-mode-active .story-content img,
body.story-mode-active .story-content video {
    width: 760px; /* Larger for story mode */
}

body.story-mode-active .story-content p {
    max-width: 50%;
    font-size: x-large;
}

body.story-mode-active .story-overlay {
    overflow: hidden;
}

audio {
    display: none;
}

.container {
    margin-top: 10px;
    width: 50%;
    /* min-width: 400px; */
    background-color: rgb(1, 33, 17);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    opacity: 0.9;
    z-index: 100;
}

.appHeading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-height: fit-content;
    margin-bottom: 20px;
}
.infoTitle {
    color: #f0aa1e;
    font-size: xx-large;
    font-family: "HoltwoodOneSC", 'NotoSansJP', 'NotoSansSC', sans-serif;
}
#infoButton {
    background-color: transparent;
    color: #fce732;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: small;
    font-family: monospace;
    margin-top: -10px;
    max-height: fit-content;
}

.info-overlay {
    position: fixed;
    top: 10%;
    width: 50%;
    height: 85%;
    background-color: rgb(18, 1, 87); /* Semi-transparent background */
    border-radius: 10px;
    display: none; /* Hidden initially */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 3000; /* Ensure it's above all other content */
    overflow-y: auto; /* Allow scrolling for longer content */
}
.info-logo { 
    width: 256px;
    height: 256px;
}
#chosenLanguage { 
    font-family: monospace, 'NotoSansJP', 'NotoSansSC', sans-serif;
    font-size: small;
    color: #ffffff;
    background-color: #005819;
    border: dotted;
    opacity: 0.8;
    margin-top: 10px;
}
#infoText {
    text-align: center;
    font-size: small;
    /* font-family: Verdana, 'Segoe UI', Tahoma, sans-serif; */
    font-family: monospace, 'NotoSansJP', 'NotoSansSC', sans-serif;
    margin-top: 20px;
    margin-left: 40px;
    margin-right: 40px;
}
#closeInfoButton {
    background-color: #3261fc;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: large;
    padding: 10px 20px;
    max-height: fit-content;
    margin-top: 10px;
}
#userInfo {
    font-size: small;
    font-family: monospace, 'NotoSansJP', 'NotoSansSC', sans-serif;
    color: #ffffff;
    /* margin-top: 4px; */
}
#generationLimits {
    font-size: small;
    font-family: monospace, 'NotoSansJP', 'NotoSansSC', sans-serif;
    color: #FFD700;
}
#logoutLink {
    font-size: small;
    font-family: monospace, 'NotoSansJP', 'NotoSansSC', sans-serif;
    color: #4A90E2;
    text-decoration: underline;
    cursor: pointer;
}
#deleteAccountLink {
    font-size: small;
    font-family: monospace, 'NotoSansJP', 'NotoSansSC', sans-serif;
    color: #FF4444;
    text-decoration: underline;
    cursor: pointer;
}

.container-buttons {
    width: 100%; /* Ensuring full width */
    display: flex;
    justify-content: space-between;
}
button {
    background-color: #876402; /* Cheerful button color */
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    transition: transform 0.3s;
    margin-top: 20px;
    font-size: small;
    font-family: "Quicksand", 'NotoSansJP', 'NotoSansSC', sans-serif;
    /* font-family: Verdana, 'Segoe UI', Tahoma, sans-serif; */
}
#startButton {
    width: 150px;
    font-weight: 600;
}
.goButton {
    background-color: #184fae;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    transition: transform 0.3s;
    margin-top: 20px;
    font-size: small;
    font-family: "Quicksand", 'NotoSansJP', 'NotoSansSC', sans-serif;
    /* font-family: Verdana, 'Segoe UI', Tahoma, sans-serif; */
}

button:hover {
    transform: scale(1.1);
}

input[type="radio"] {
    accent-color: #4dd7f7; /* Fun radio button color */
}

label {
    margin-left: 10px; /* Space between radio button and label */
    color: #ffffff;
}
.titles {
    margin-top: 40px;
    font-size: large;
}
.option-group {
    display: flex;
    flex-direction: row;
    align-items: flex-start; /* Aligns items to the left */
    width: 100%;
    margin-top: 40px;
    gap: 20px;
}
.option-group-B {
    display: flex;
    flex-direction: row;
    align-items: flex-start; /* Aligns items to the left */
    width: 100%;
    margin-top: 10px;
    gap: 20px;
}
.option-item {
    display: flex;
    align-items: center; /* Vertically aligns radio buttons and labels */
    margin-bottom: 5px; /* Adjust spacing between options */
}
#story-A-option {
    font-size: large;
}
#story-B-option {
    font-size: large;
}
#story-C-option {
    font-size: large;
}

.container-choices {
    width: 100%; /* Ensuring full width */
    /* display: flex;
    justify-content: space-between; */
}
.container-upload {
    min-width: 50%;
}

#textInput, #imageInput, #picturePreview, #archiveContent {
    display: block; /* Always show these elements */
    margin-bottom: 20px; /* Consistent spacing */
}
/* #textInput {
    margin-top: 20px;
    width: 80%;
    height: fit-content;
    resize: none;
} */
#textInput {
    margin-top: 20px;
    width: 100%;
    /* max-width: 100%; */
    border-radius: 18px;
    border: 2px solid #ca9f6a;
    font-family: 'Gluten', 'NotoSansJP', 'NotoSansSC', sans-serif;
    font-size: 0.8em;
    padding: 14px 8px 4px 60px;
    background: #fffbe6 url('/static/assets/waiting_bee_1.png') 12px center no-repeat;
    background-size: 36px 36px;
    box-shadow: 0 2px 8px rgba(30,0,0,0.08);
    box-sizing: border-box;
    transition: border-color 0.2s;
}
#textInput:focus {
  border-color: #f0aa1e;
  outline: none;
}

#imageInput {
    margin-top: 40px;
    width: fit-content;
    max-width: 50%;
    height: fit-content;
}
/* #picturePreview {
    height: 200px;
    width: 100%;
    background-color: #ddd;
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    border: 1px solid #ccc;
} */ 
#picturePreview {
    margin-top: 20px;
    height: 200px;
    width: 100%;
    /* background-color: #fffbe6; */
    background: #fffbe6 url('/static/assets/logo_silhouette.png') 200px center no-repeat;
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    border: 2px dashed #ca9f6a;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: monospace, 'NotoSansJP', 'NotoSansSC', sans-serif;
    font-size: medium;
    color: #667;
}
#picturePreview:hover {
    border-color: #f0aa1e;
    background-color: #f0f0f0;
}
#picturePreview.has-image {
    color: transparent; /* Hide text when image is loaded */
}

#archiveContent {
    margin-top: 20px;
    height: 200px;
    width: 100%;
    border: 2px dashed #ca9f6a;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Quicksand', 'NotoSansJP', 'NotoSansSC', sans-serif;
    font-size: medium;
    background-color: white;
    color: black;
    display: none;
    overflow: hidden;
    position: relative;
}
#archiveStoriesSelect {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    font-size: inherit;
    font-family: inherit;
    color: inherit;
    outline: none;
    overflow-y: auto;
    box-sizing: border-box;
    /* Optional: remove default focus ring for a cleaner look */
}
#archiveStoriesSelect option {
    padding: 8px;
    font-size: medium;
}

.custom-imageInput {
    margin-bottom: 5px;
    display: inline-block;
    padding: 6px 12px;
    cursor: pointer;
    font-size: medium;
    font-family: monospace, 'NotoSansJP', 'NotoSansSC', sans-serif;
    background-color: #9f9f9f;
}
#chosenImage {
    font-size: small;
    font-family: monospace, 'NotoSansJP', 'NotoSansSC', sans-serif;
}
#imageInput {
    display: none;
}

#progressUpdate {
    margin-top: 20px;
    max-width: 100%;
    height: 100px; /* Fixed height for progress update box */
    overflow-y: auto; /* Scrollable if text overflows */
    background-color: #000000;
    color: #9f9f9f; /* Readable label color */
    padding: 10px;
    margin-top: 20px;
    font-family: /*"Gill Sans Extrabold", sans-serif*/ 'Courier New', Courier, monospace, 'NotoSansJP', 'NotoSansSC', sans-serif;
    font-size: small;
    /*font-weight: bold;*/
    overflow-wrap: break-word; /* Ensures words break to prevent overflow */
    white-space: pre-wrap; /* Wrap text and preserve whitespaces and line breaks */
}
/* Style for WebKit browsers */
#progressUpdate::-webkit-scrollbar {
    width: 12px; /* Adjust the width of the scrollbar */
}
#progressUpdate::-webkit-scrollbar-track {
    background: #f1f1f1; /* Color of the track */
}
#progressUpdate::-webkit-scrollbar-thumb {
    background: #888; /* Color of the scrollbar thumb */
}
#progressUpdate::-webkit-scrollbar-thumb:hover {
    background: #555; /* Color when hovered */
}
/* Style for Firefox */
#progressUpdate {
    scrollbar-width: thin; /* "auto" or "thin" */
    scrollbar-color: #888 #f1f1f1; /* thumb and track color */
}

.progress-warning {
    top: 20px;
    min-width: 220px;
    max-width: 80vw;
    padding: 16px 32px;
    background: rgba(40,40,60,0.95);
    color: #fff;
    font-size: 1.2em;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    z-index: 102;
    text-align: center;
    pointer-events: none;
    opacity: 0;
}

.progress-slick {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    max-width: 80vw;
    padding: 16px 32px;
    background: rgba(40,40,60,0.95);
    color: #fff;
    font-size: 1.2em;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    z-index: 101;
    text-align: center;
    pointer-events: none;
    opacity: 0;
}

.story-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100svh; /* Respect the actual visible viewport height */
    height: 100vh;  /* Fallback for older browsers */
    background-color: rgb(30, 0, 0); /* Semi-transparent background */
    display: none; /* Hidden initially */
    z-index: 1000; /* Ensure it's above all other content */
    overflow-y: auto; /* Allow scrolling for longer content */
}

.story-content {
    padding: 20px;
    /* text-align: center; */
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.cover-image { 
    max-width: 512px;
    opacity: 0.3;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
}
.cover-text {
    position: absolute;
    top: 50%;
    left: 60%;
    width: 20%;
    transform: translate(-50%, -50%);
    z-index: 1002;
}
.story-content img, .story-content video {
    /* max-width: 45%; */
    width: 512px;
    height: auto; /* Maintain aspect ratio */
    margin: 0;
    border: #876402 2px solid;
}
.story-content p {
    max-width: 45%; /* Adjust as needed */
    margin: 0 auto; /* center the element within its container */
    background-color: rgb(40, 10, 0);
    text-align: center;
    font-family: 'HoltwoodOneSC', 'NotoSansJP', 'NotoSansSC', sans-serif;
    font-size: large;
    color: rgb(202, 159, 106);
    margin: 0;
}
.story-content span {
    display: inline-block;
    font-family: 'HoltwoodOneSC', 'NotoSansJP', 'NotoSansSC', sans-serif;
    font-size: large;
}
.story-controls {
    display: flex;
    max-width: 100%; /* Adjust as needed */
    align-items: center;
    justify-content: center; /* Center horizontally */
    padding-bottom: 20px;
    gap: 20px;
}
.story-buttons {
    width: 150px;
    height: 70px;
    font-size: medium;
    z-index: 1020;
}
.close-story-button {
    font-size: small;
    z-index: 1021;
}

#ratingContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
    margin-top: 10px;
    gap: 5px;
    font-size: medium;
    color: rgb(202, 159, 106);
    font-family: monospace, 'NotoSansJP', 'NotoSansSC', sans-serif;
}
.star {
    transition: color 0.2s;
    margin: 0 4px;
}
#starMessage {
    margin-top: 0px;
    font-size: xx-small;
    color: rgb(202, 159, 106);
}
#actionMessage {
    margin-top: 0px;
    font-size: x-small;
    color: #FFD700;
}
#addedOptions {
    display: flex;
    max-width: 100%;
    justify-content: flex-end;
    margin-right: 10px;
    gap: 10px;
}
#easyReading {
    /* background-color: #876402; */
    background-color: #6d5002;
    color: #cccccc;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s;
    font-family: 'NotoSans', 'NotoSansJP', 'NotoSansSC', sans-serif;
    font-size: small;
    height: fit-content;
    width: 120px;
    z-index: 1012;
}
#exportPDF {
    background-color: #013f04;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s;
    font-size: small;
    height: fit-content;
    width: 120px;
    z-index: 1010;
}
#exportURL {
    background-color: #013f04;
    color: rgb(197, 214, 7);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s;
    font-size: small;
    height: fit-content;
    width: 120px;
    z-index: 1011;
}

/* Share Overlay */
.share-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-overlay.hidden {
    display: none;
}

.share-backdrop { 
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(1, 33, 17, 0.95);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.share-modal {
    position: relative;
    background: rgb(18, 1, 87);
    border-radius: 10px;
    padding: 52px 24px 40px 24px;
    max-width: 90%;
    width: 400px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.share-close {
    position: absolute;
    top: -10px;
    right: 8px;
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 1;
    transition: color 0.3s;
}

.share-close:hover {
    color: #fff;
    transform: none;
}

.share-state {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.share-state.hidden {
    display: none;
}

.share-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #fce732;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#shareURLInput {
    width: 100%;
    padding: 12px 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-family: monospace, 'NotoSansJP', 'NotoSansSC', sans-serif;
    font-size: 11px;
    text-align: center;
    margin-bottom: 24px;
    outline: none;
    overflow: hidden;
    text-overflow: ellipsis;
}

#shareURLInput:focus {
    border-color: #fce732;
}

.share-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: center;
}

.qr-container {
    background: #fff;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.share-icon-btn {
    width: 100%;
    height: 56px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
}

.share-icon-btn svg {
    width: 24px;
    height: 24px;
    transition: transform 0.2s;
}

.share-icon-btn:not([disabled]):hover {
    background: rgba(252, 231, 50, 0.1);
    border-color: #fce732;
    transform: scale(1.05);
}

.share-icon-btn:not([disabled]):hover svg {
    transform: scale(1.1);
}

.share-icon-btn[disabled],
.share-icon-btn.hidden {
    opacity: 0.3;
    pointer-events: none;
}

.share-error {
    color: #ff6b6b;
    font-size: 14px;
    text-align: center;
    font-family: monospace, 'NotoSansJP', 'NotoSansSC', sans-serif;
    margin-top: 16px;
    padding: 12px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 8px;
}

.error-message {
    color: #d32f2f;
    font-size: 14px;
    text-align: center;
    margin-top: 8px;
}
#bee {
    position: absolute;
    top: -100px; /* Start off-screen */
    left: -100px;
    width: auto; /* Adjust size as needed */
    height: auto;
    z-index: 99;
}

/* Game iframe container */
.game-iframe-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(1, 33, 17, 0.65);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    transition: opacity 0.3s ease;
    pointer-events: auto; /* Prevent clicking through */
}

.game-iframe-container.hidden {
    display: none;
}

.game-iframe-container.game-invite-small {
    background: transparent; /* Only transparent when small */
}

.iframe-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1501;
}

.iframe-controls button {
    background: rgba(135, 100, 2, 0.9);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    font-family: 'Quicksand', 'NotoSansJP', 'NotoSansSC', sans-serif;
    font-size: 14px;
    transition: all 0.3s;
}

.iframe-controls button:hover {
    background: rgba(168, 159, 145, 0.9);
    transform: scale(1.05);
}

.iframe-controls button.hidden {
    display: none;
}

#gameIframe {
    width: 80%;
    max-width: 1000px;
    height: 90%;
    max-height: 800px;
    border: 2px solid rgba(168, 159, 145, 0.5);
    border-radius: 24px;
    background: #0a1410;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

/* Small invitation state */
.game-invite-small #gameIframe {
    width: 500px;
    height: 300px;
    max-width: 90vw;
    max-height: 400px;
}

.game-status-banner {
    width: fit-content;
    background: rgba(100,100,100,0.2);
    color: #cccccc;
    font-family: 'Gluten', 'Quicksand', sans-serif;
    font-size: 0.8em;
    text-align: center;
    padding: 10px 0;
    z-index: 2000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: background 0.3s;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
}

/* --- Showcase Popup Styles --- */
.showcase-popup {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    transition: opacity 0.3s;
}
.showcase-popup.hidden {
    display: none;
}
/* .showcase-backdrop {
    position: absolute;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: radial-gradient(circle at 50% 0%, #0f3d2e 0%, #001a0a 100%);
    opacity: 0.92;
    z-index: 0;
} */
.showcase-modal {
    position: relative;
    background: rgba(86, 80, 56, 0.95);
    border-radius: 12px;
    border-color: #a89f91;
    border-width: 2px;
    border-style: solid;
    box-shadow: 0 0 60px 0 rgba(115, 101, 45, 0.45);
    padding: 48px 36px 36px 36px;
    max-width: 420px;
    width: 120vw;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.showcase-close {
    /* position: absolute;
    top: 18px; right: 18px; */
    background: transparent;
    border: none;
    font-size: 28px;
    color: #a89f91;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 3;
}
.showcase-close:hover {
    color: #f3cf6f;
}
.showcase-content {
    text-align: center;
    z-index: 2;
}
.showcase-title {
    font-family: 'Playfair Display', 'NotoSansJP', 'NotoSansSC', serif;
    color: #f3cf6f;
    /* background-color: rgb(115, 97, 39); */
    font-size: 2.2rem;
    margin-bottom: 18px;
    letter-spacing: -0.5px;
}
.showcase-divider {
    border: 0;
    height: 1px;
    width: 60%;
    background: linear-gradient(to right, transparent, #a89f91, transparent);
    opacity: 0.5;
    margin: 0 auto 32px auto;
}
.showcase-message {
    font-family: 'Quicksand', 'NotoSansJP', 'NotoSansSC', sans-serif;
    color: #d7bf9a;
    font-size: 1.15rem;
    font-weight: 400;
    margin-bottom: 0;
    line-height: 1.7;
}
@media (max-width: 600px) {
    .showcase-modal { padding: 24px 10px 18px 10px; }
    .showcase-title { font-size: 1.3rem; }
    .showcase-message { font-size: 1rem; }
}

@media (max-width: 768px) {
    #gameIframe {
        width: 95%;
        height: 85%;
    }
    
    .game-invite-small #gameIframe {
        width: 90vw;
        height: 250px;
    }
    
    .iframe-controls {
        top: 10px;
        right: 10px;
        gap: 5px;
    }
    
    .iframe-controls button {
        padding: 8px 12px;
        font-size: 8px;
    }

    .game-status-banner {
        font-size: 0.6em;
        padding: 0px 0;
    }
}

@media (max-width: 1600px) {
    .info-logo {
        width: 120px;
        height: 120px;
    }
    #closeInfoButton {
        margin-top: 0px;
        font-size: medium;
    }
}
@media (max-width: 1450px) {
    .container {
        width: 70%;
    }
    .info-overlay {
        width: 70%;
        gap: 0px;
    }
    #infoText {
        text-align: center;
        font-size: x-small;
        /* font-family: Verdana, 'Segoe UI', Tahoma, 'NotoSansJP', 'NotoSansSC', sans-serif; */
    }    
    #textInput {
        font-size: small;
    }
    .cover-image {
        max-width: 90%;
    }
    .story-content img, .story-content video {
        max-width: 90%;
    }    
}
@media (max-width: 1050px) {
    body {
        align-items: normal;
        overflow: auto;
    }
    .container {
        width: 90%;
    }
    .info-overlay {
        width: 90%;
        gap: 0px;
    }
    #infoText {
        text-align: center;
        font-size: x-small;
        /* font-family: Verdana, 'Segoe UI', Tahoma, 'NotoSansJP', 'NotoSansSC', sans-serif; */
    }
    .option-group {
        display: flex;
        flex-direction: column;
        margin-top: 20px;
        gap: 10px;
        font-size: medium;
    }
    #story-A-option {
        font-size: small;
    }
    #story-B-option {
        font-size: small;
    }
    #story-C-option {
        font-size: small;
    }
    .cover-image {
        max-width: 70%;
    }
    .cover-text {
        top: 50%;
        left: 50%;
        width: 40%;
        transform: translate(-50%, -50%);
    }
    .story-content {
        flex-direction: column;
    }
    .story-content p {
        font-size: small;
        max-width: 90%;
    }
    .story-content span {
        font-size: small;
    }
    .story-buttons {
        width: 120px;
        height: 50px;
        font-size: small;
        padding: 10px;
    }
    .close-story-button {
        font-size: x-small;
        padding: 10px;
    }
    .share-modal {
        width: 95%;
        padding: 32px 16px;
        border-radius: 8px;
    }

    .share-close {
        top: -20px;
        right: 8px;
        width: 28px;
        height: 28px;
        font-size: 18px;
    }

    #shareURLInput {
        font-size: 10px;
        padding: 10px 6px;
        margin-bottom: 16px;
    }

    .share-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .qr-container {
        min-height: 180px;
        padding: 12px;
    }

    .qr-container img {
        max-width: 100%;
        height: auto;
    }

    .share-buttons {
        flex-direction: row;
        gap: 12px;
    }

    .share-icon-btn {
        height: 48px;
        min-width: 48px;
    }

    .share-icon-btn svg {
        width: 20px;
        height: 20px;
    }

    .share-spinner {
        width: 36px;
        height: 36px;
    }
}
@media (max-width: 450px) {
    body {
        font-size: medium;
    }
    .infoTitle {
        font-size: medium;
    }
    .option-group {
        display: flex;
        flex-direction: column;
    }
    .custom-imageInput {
        font-size: small;
    }
    #chosenImage {
        font-size: x-small;
    }
    
    .titles {
        font-size: medium;
    }
    .option-group-B {
        display: flex;
        flex-direction: column;
    }
    #story-A-option {
        font-size: medium;
    }
    #story-B-option {
        font-size: medium;
    }
    #story-C-option {
        font-size: medium;
    }
    #progressUpdate {
        font-size: x-small;
    }
    .story-content {
        flex-direction: column;
    }
    /* .cover-text {
        width: 150px;
    } */
    button {
        font-size: x-small;
    }
    .goButton {
        font-size: x-small;
    }
}

