/* --- Gothic Font Definition --- */
/* The TNO_Gothic font is now loaded directly from Google Fonts in the main astro file. */

/* --- Generator Page Styles --- */
.generator-container {
    max-width: 1280px; margin: 20px auto; padding: 30px 40px;
    background: rgba(255, 255, 255, 0.15); -webkit-backdrop-filter: blur(8px) saturate(160%); backdrop-filter: blur(8px) saturate(160%);
    border-radius: 15px; border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
}
.generator-container h2 {
    text-align: center; color: #ffc107; margin-bottom: 30px;
    font-family: 'Roboto Condensed', sans-serif; font-size: 2em;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}
.form-grid { display: grid; grid-template-columns: 1fr; gap: 20px; margin-bottom: 25px; }
.form-group { margin-bottom: 0; }
.form-group label {
     display: block; margin-bottom: 8px; font-weight: 500;
     color: #445; font-size: 0.95em; text-shadow: 0 1px 1px rgba(255,255,255,0.1);
}
.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%; padding: 12px 15px; border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px; background: rgba(0, 0, 0, 0.15); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
    outline: none; transition: all 0.3s ease; box-sizing: border-box; font-size: 1em;
    color: #333; font-family: inherit;
}
 .form-group input::placeholder,
 .form-group textarea::placeholder { color: #777; }
 .form-group textarea { min-height: 70px; resize: vertical; }
 .form-group select {
     appearance: none;
     background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23555555' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
     background-repeat: no-repeat; background-position: right 10px center; background-size: 16px 12px; padding-right: 35px;
 }
 .form-group select:disabled { opacity: 0.6; background-color: rgba(0,0,0,0.2); cursor: not-allowed; color: #777; }
 .form-group input:focus,
 .form-group textarea:focus,
 .form-group select:focus {
    background: rgba(0, 0, 0, 0.2); border-color: rgba(135, 206, 250, 0.7);
    box-shadow: 0 0 8px rgba(135, 206, 250, 0.4);
 }

/* API Key Input */
.api-key-wrapper { position: relative; display: flex; align-items: center; }
.api-key-wrapper input { padding-right: 45px; flex-grow: 1; }
#toggle-api-key-visibility {
     position: absolute; right: 1px; top: 50%; transform: translateY(-50%);
     background: none; border: none; cursor: pointer; padding: 10px;
     color: #777; font-size: 1.2em; line-height: 1; opacity: 0.7; transition: opacity 0.2s;
}
#toggle-api-key-visibility:hover { opacity: 1; color: #333; }
#toggle-api-key-visibility:focus { outline: none; }

/* API URL + Fetch Button */
.api-url-wrapper { display: flex; gap: 0; align-items: stretch; }
.api-url-wrapper input[type="url"] { flex-grow: 1; border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: none; }
#fetch-models-btn {
     flex-shrink: 0; padding: 10px 18px; border: 1px solid rgba(0, 0, 0, 0.1);
     border-left: none; border-top-left-radius: 0; border-bottom-left-radius: 0;
     background: linear-gradient(to bottom, rgba(255, 193, 7, 0.2), rgba(255, 152, 0, 0.2));
     -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); color: #cc8400; cursor: pointer;
     font-weight: 500; font-size: 0.95em; transition: all 0.3s ease; height: auto;
}
 #fetch-models-btn:hover {
     background: linear-gradient(to bottom, rgba(255, 193, 7, 0.3), rgba(255, 152, 0, 0.3));
     color: #e69500; box-shadow: -2px 0 5px rgba(255, 152, 0, 0.2);
 }
 #fetch-models-btn:disabled { opacity: 0.5; cursor: not-allowed; background: rgba(0,0,0,0.1); color: #888; box-shadow: none; }
 #model-loading-indicator { margin-left: 8px; color: #555; font-size: 1.2em; vertical-align: middle; }
 .form-group .input-hint { font-size: 0.85em; color: #666; display:block; margin-top: 5px; }

.api-warning { background-color: rgba(255, 243, 205, 0.6); color: #856404; border: 1px solid rgba(255, 238, 186, 0.7); border-radius: 5px; padding: 10px 15px; font-size: 0.9em; margin-bottom: 20px; text-align: center; }

/* Generate Button */
#generate-tno-btn {
     padding: 12px 25px; border: none; border-radius: 8px;
     background: linear-gradient(to bottom, rgba(135, 206, 250, 0.6), rgba(100, 181, 246, 0.6));
     -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); color: #fff; font-size: 1.1em; font-weight: 600;
     cursor: pointer; transition: all 0.3s ease; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
     border: 1px solid rgba(255, 255, 255, 0.2); margin-top: 20px; display: block; width: 100%;
}
 #generate-tno-btn:hover { background: linear-gradient(to bottom, rgba(135, 206, 250, 0.7), rgba(100, 181, 246, 0.7)); box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2); transform: translateY(-2px); }
 #generate-tno-btn:disabled { background: rgba(0,0,0,0.2); color: #888; cursor: not-allowed; box-shadow: none; transform: none; border-color: rgba(0,0,0,0.1); }

/* Output Area */
#tno-output-area { margin-top: 30px; border: 1px solid rgba(0,0,0,0.08); border-radius: 8px; background: rgba(0,0,0,0.05); padding: 15px; min-height: 100px; display: flex; justify-content: center; align-items: center; overflow: hidden; }
#tno-loading-indicator, #tno-error-message { display: none; text-align: center; padding: 20px; }
#tno-loading-indicator { color: #555; font-size: 1.1em; animation: pulse 1.5s infinite ease-in-out; }
#tno-error-message { color: #f8d7da; background-color: rgba(248, 215, 218, 0.1); border: 1px solid rgba(245, 198, 203, 0.3); padding: 10px; border-radius: 5px; }


/* --- TNO Screenshot Styles --- */
body.tno-preview-active { background-color: #2d2d2d; }
.tno-ui-wrapper {
    position: relative;
    width: 100%;
    max-width: none; /* Remove max-width to allow full width */
    min-height: 720px; /* Approximate height of the game screen */
    margin: 0 auto;
    overflow: hidden;
    background-color: #31373f; /* Fallback color */
}

/* .tno-ui-wrapper.modal-active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 5;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
} */

.tno-main-screen {
    display: flex;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.left-column {
    width: 480px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background-color: #2a2e34;
    border-right: 2px solid #1a1f25;
    padding: 8px; /* Add some padding to the column */
}

/* --- New Country Panel Styles --- */
.country-panel {
    background-color: #31373f; /* Correct background color */
    border: 1px solid #1a1f25;
    color: #e0e0e0;
    font-family: 'Noto Sans SC', sans-serif;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

.country-panel-header {
    display: flex;
    align-items: center;
    background-color: #24292e;
    padding: 4px;
    border-bottom: 1px solid #1a1f25;
    box-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

.header-left-icons {
    display: flex;
    margin-right: 8px;
}

.country-flag-container {
    width: 60px;
    height: 40px;
    background-color: #000;
    border: 1px solid #111;
    padding: 2px;
    box-sizing: border-box;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 0 4px 1px rgba(0,0,0,0.5);
}

.country-flag-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.05) 0, rgba(255,255,255,0.05) 1px, transparent 1px, transparent 2px);
    z-index: 2;
}

.ideology-icon-container {
    width: 40px;
    height: 40px;
    background-color: #111;
    border: 1px solid #1a1f25;
    border-left: none;
}
#tno-ideology-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
#tno-flag-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(0.4px) saturate(0.8);
    transform: scale(1.05);
    opacity: 0.9;
}

.country-name-area {
    flex-grow: 1;
    font-size: 0.9em;
    font-weight: 500;
    line-height: 1.3;
    text-align: left;
    padding: 0 8px;
}

.country-faction-logo {
    width: 40px;
    height: 40px;
    background-color: #111;
    border: 1px solid #1a1f25;
}
#tno-faction-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.country-panel-body {
    display: flex;
    padding: 8px;
    gap: 8px;
    border-top: 1px solid #4a5562;
    align-items: flex-start; /* Prevent items from stretching */
}

.leader-portrait {
    flex-shrink: 0;
    width: 130px;
    height: 160px; /* Set a fixed height */
    border: 1px solid #1a1f25;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
    background-color: #222;
    /* New styles for background image approach */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
#tno-leader-portrait {
   display: none !important; /* Hide the img element itself */
}

.right-content-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: #2d343c;
    border: 1px solid #1a1f25;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
    padding: 8px;
    gap: 8px;
}

.politics-main-area {
    display: flex;
    align-items: center;
    gap: 2px;
}

.political-pie-chart {
    width: 20px;
    height: 20px;
    padding: 2px;
    flex-shrink: 0;
    border: 2px solid #111;
    border-top-color: #333;
    border-left-color: #333;
    background-color: #24292e;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
}

.politics-details {
    text-align: left;
    flex-grow: 1;
    padding: 4px 0;
}
.party-name, .party-ideology, .next-election {
    font-size: 0.9em;
    line-height: 1.3;
    writing-mode: horizontal-tb !important;
}
.party-name {
    font-weight: 700;
    font-size: 1em;
    color: #e0e0e0;
}
.party-ideology, .next-election {
    color: #b0b0b0;
}

.horizontal-divider {
    border-bottom: 1px solid #4a5562;
    width: 100%;
    margin: 4px 0; /* Small vertical margin */
}

.country-panel-footer {
    display: flex;
    align-items: stretch; /* Make items same height */
    gap: 8px;
}

.focus-icon-container {
    width: 56px;
    height: 56px;
    background-color: #24292e;
    border: 2px solid #111;
    border-top-color: #333;
    border-left-color: #333;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border-radius: 2px;
}
#tno-focus-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.focus-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    padding: 10px;
    font-size: 1.2em;
    font-weight: 700;
    color: #e0e0e0;
    cursor: pointer;
    border: 1px solid #00bfff;
    background-color: #2d343c;
    text-align: center;
    box-sizing: border-box;
    overflow: hidden; /* To contain the progress bar */
    border-radius: 4px;
}

.focus-button::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 2px;
    right: 2px;
    height: 6px;
    background-color: rgba(0, 191, 255, 0.3);
    border-radius: 3px;
}

.focus-button::before {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 2px;
    width: 75%; /* Example progress */
    height: 6px;
    background-color: #00bfff;
    border-radius: 3px;
    z-index: 1;
}

.focus-button:hover {
    background-color: rgba(74, 85, 98, 0.5);
}

.left-section { border-bottom: 1px solid #1a1f25; padding: 8px; background-color: #31373f; }
.left-section-darker { background-color: #2a2e34; }
.left-section-darkest { background-color: #24292e; }

.leader-info { display: flex; align-items: center; padding-bottom: 10px; }
.leader-portrait { flex-shrink: 0; cursor: pointer; }
#tno-leader-portrait { width: 90px; height: 115px; object-fit: cover; border: 1px solid #4a5562; margin-right: 10px; filter: grayscale(10%) brightness(1.0); background-color: #222; display: block; }
.leader-details { flex-grow: 1; }
.leader-name { font-family: 'Noto Sans SC', sans-serif; font-weight: 700; color: #e0e0e0; font-size: 1.2em; margin-bottom: 5px; }
.leader-trait { display: flex; align-items: center; font-size: 0.9em; color: #a0a0a0; margin-top: 8px;}
.trait-icon { width: 20px; height: 20px; border: 1px solid #ccc; background-color: #eee; color: #333; margin-right: 5px; display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0;}
.trait-text { font-family: 'Roboto Condensed', sans-serif; color:#c0d0e0; }

.national-focus-panel { padding: 0; }
.nf-title-bar { background: linear-gradient(to bottom, #5a7a9a, #4a6a8a); padding: 5px 10px; font-family: 'Roboto Condensed', sans-serif; font-weight: 700; color: #e0f0ff; font-size: 1.1em; text-align: center; text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid #2a4a6a; }
.nf-content { padding: 10px; background-color: #31373f; }
.nf-main-focus { display: flex; align-items: center; margin-bottom: 10px; padding-bottom: 10px; }
.nf-main-icon { width: 50px; height: 50px; border: 1px solid #B0E0E6; margin-right: 10px; flex-shrink: 0; background-color: #222; display: flex; justify-content: center; align-items: center; }
#tno-focus-icon-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.nf-main-details .title { font-family: 'Noto Serif SC', serif; font-weight: 700; color: #f0f8ff; font-size: 1.1em; margin-bottom: 3px; }
.nf-main-details .description { font-size: 0.85em; color: #b0c4de; line-height: 1.3; }

.national-spirits-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px; /* Space between icons */
    padding: 8px 0;
    border-top: 1px solid #1a1f25;
}

.national-spirit-icon {
    width: 52px;
    height: 52px;
    background-color: #24292e;
    border: 1px solid #1a1f25;
    padding: 2px;
    box-sizing: border-box;
    cursor: pointer;
    position: relative;
}

.national-spirit-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.national-spirit-icon.loading::after,
.national-spirit-icon.error::after {
    content: '⏳';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    color: #888;
}

.national-spirit-icon.error::after {
    content: '❌';
    color: #a83232;
}


.political-info { font-size: 0.9em; color: #b0b0b0; padding: 10px; }
.political-info .party-info { display: flex; align-items: center; margin-bottom: 5px; }
.party-icon { width: 22px; height: 22px; border: 1px solid #ccc; background-color: #eee; color: #333; margin-right: 8px; flex-shrink: 0; text-align: center; line-height: 20px;}
.party-name { font-weight: 700; color: #E0FFFF; }
.party-ideology, .next-election { padding-left: 30px; margin-bottom: 3px; }
.next-election span { color: #AFEEEE; font-weight: normal;}

.political-pie { padding: 10px; }
.political-pie-chart {
    position: relative; /* Needed for the overlay */
    display: block;
    margin: 5px auto;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 1px solid #444;
    background-color: #222;
    cursor: pointer;
    box-shadow:
        inset 0 0 15px 5px rgba(0,0,0,0.75), /* Inner shadow for depth */
        0 0 10px 2px rgba(173, 216, 230, 0.2); /* Faint outer glow */
    overflow: hidden; /* Hide the overlay overflow */
}

.political-pie-chart::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.25) 0px,
        rgba(0, 0, 0, 0.25) 1px,
        transparent 1px,
        transparent 3px
    );
    z-index: 1;
    border-radius: 50%;
}

.flag-stats { display: flex; align-items: center; padding: 10px; }
#tno-flag-img { width: 70px; height: auto; margin-right: 10px; border: 1px solid #555; background-color: #222; display: block; }
.stats-text { font-family: 'Roboto Condensed', sans-serif; font-size: 1.1em; color: #c0c0c0; line-height: 1.3; font-weight: 700; }
.stats-text span { display: inline-block; margin-left: 5px; font-weight: normal; color: #eee; }

/* --- Draggable Window Styles --- */
.tno-draggable-window {
    position: absolute;
    z-index: 9;
    background-color: #2d343c;
    border: 2px solid #1a1f25;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.window-header {
    padding: 6px 10px;
    cursor: move;
    z-index: 10;
    background-color: #1a1f25;
    color: #e0e0e0;
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 700;
    text-align: center;
}

/* --- Newspaper Window Specific Styles --- */
.newspaper-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 550px; /* Adjusted width */
    background-color: #fdfbf5; /* Off-white paper color */
    border: 1px solid #ccc;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    color: #1a1a1a; /* Dark ink color */
    font-family: 'Noto Serif SC', serif;
    display: flex;
    flex-direction: column;
}

.newspaper-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    background-color: #e8e4d9;
    padding: 4px 10px;
    border-bottom: 2px solid #000;
}

.header-left {
    font-family: 'Times New Roman', Times, serif;
    font-size: 10px;
    text-transform: uppercase;
    line-height: 1.1;
}
.four-star {
    font-size: 14px;
    letter-spacing: 2px;
    color: #000;
}

.header-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 28px;
    line-height: 1;
    text-align: center;
    color: #000;
}

.header-right .price {
    font-family: 'Times New Roman', Times, serif;
    font-size: 18px;
    font-weight: bold;
}

.newspaper-top-line {
    background-color: #e8e4d9;
    text-align: center;
    padding: 2px 0;
    border-bottom: 1px solid #000;
}
.city-final {
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 1px;
    color: #000;
}

.newspaper-body {
    padding: 15px;
}

.newspaper-headline {
    font-family: 'Noto Serif SC', serif;
    font-weight: 700;
    font-size: 36px;
    text-align: center;
    margin: 0 0 15px 0;
    line-height: 1.2;
    color: #000;
}

.newspaper-main-content {
    display: flex;
}

.newspaper-article {
    display: flex;
    gap: 15px;
}

.article-image-container {
    width: 40%; /* Use a percentage-based width */
    max-width: 220px; /* Set a max-width to prevent it from becoming too large */
    flex-shrink: 0;
    border: 1px solid #ccc;
    box-sizing: border-box;
    aspect-ratio: 2 / 3; /* Maintain a 2:3 aspect ratio */
    position: relative; /* Needed for the image to fill it */
}
#tno-newspaper-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the area, cropping if necessary */
    display: block;
    filter: grayscale(100%) contrast(1.1);
}

.article-text {
    font-size: 14px;
    line-height: 1.6;
    text-align: justify;
    flex-grow: 1; /* Allow text to take up remaining space */
}
.article-text p {
    margin-top: 0;
    margin-bottom: 1em;
    break-inside: avoid-column;
}

.newspaper-footer {
    padding: 10px;
    background-color: #e8e4d9;
    border-top: 1px solid #ccc;
    margin-top: auto; /* Pushes footer to the bottom */
}

.newspaper-option-button {
    width: 100%;
    padding: 10px;
    background-color: #d8d2c6;
    border: 1px solid #b0a89a;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.5);
    text-align: center;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #000;
    cursor: pointer;
    transition: background-color 0.2s;
}
.newspaper-option-button:hover {
    background-color: #c8c2b6;
}

/* --- New Event Window Styles --- */
.tno-event-new-style {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    background-color: #2d2d2d;
    border: 2px solid #1a1a1a;
    box-shadow: 0 0 0 4px #3a3a3a, 0 0 15px rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    padding: 10px;
    border-radius: 5px;
}

.tno-event-new-style .event-title-bar {
    background-color: #1c1c1c;
    color: #e0e0e0;
    text-align: center;
    padding: 5px 0;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 1.2em;
    font-weight: 700;
    border: 1px solid #111;
    border-bottom: 1px solid #444;
    margin-bottom: 10px;
    cursor: move;
}

.tno-event-new-style .event-title-bar h1 {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
}

.tno-event-new-style .event-screen {
    background-color: #000;
    border: 3px solid #222;
    border-top-color: #444;
    border-left-color: #444;
    padding: 15px;
    border-radius: 5px;
    overflow: hidden;
}

.tno-event-new-style .event-image-section {
    position: relative;
    background-color: #111;
    line-height: 0;
}

.tno-event-new-style #tno-event-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    filter: grayscale(30%) contrast(1.1);
    opacity: 0.9;
}

.image-overlay-scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        rgba(180, 220, 180, 0.15) 0,
        rgba(180, 220, 180, 0.15) 1px,
        transparent 1px,
        transparent 3px
    );
    z-index: 1;
}

.tno-event-new-style .quote-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 40px;
    box-sizing: border-box;
    z-index: 2;
    color: #fff;
    font-family: 'Noto Serif SC', Georgia, serif;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.75) 40%, transparent 100%);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.9);
}

.tno-event-new-style .quote-overlay p {
    margin: 0 0 8px 0;
    line-height: 1.5;
    font-size: 1.4em;
    font-style: normal;
}

.tno-event-new-style .quote-overlay .attribution {
    text-align: right;
    font-style: normal;
    font-size: 1.1em;
    color: #ddd;
    margin: 0;
}

.tno-event-new-style .event-main-content {
    padding: 15px;
    font-family: 'Noto Sans SC', Arial, sans-serif;
    font-size: 1em;
    line-height: 1.6;
    text-align: justify;
    color: #c8d8e8;
    background-color: rgba(0,0,0,0.3);
    margin-top: 10px;
    border-radius: 3px;
}

.tno-event-new-style .event-options-area {
    padding-top: 15px;
    display: flex;
    justify-content: center;
}

.tno-event-new-style .event-option-button {
    padding: 8px 40px;
    background-color: #3a3a3a;
    border: 2px solid #222;
    border-top-color: #555;
    border-left-color: #555;
    border-radius: 3px;
    color: #e0e0e0;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tno-event-new-style .event-option-button:hover {
    background-color: #4a4a4a;
    border-color: #333;
    border-top-color: #666;
    border-left-color: #666;
    color: #fff;
}

/* --- Responsive Styles --- */
@media (max-width: 1100px) { .tno-screen-container { flex-direction: column; max-width: 650px; } .left-column { width: 100%; border-right: none; border-bottom: 2px solid #1a1f25; } .right-column { width: 100%; } .newspaper-snippet { max-height: 120px; } }
@media (max-width: 768px) { .generator-container { padding: 20px 15px; } .generator-container h2 { font-size: 1.6em; } .api-url-wrapper { flex-direction: column; gap: 10px; align-items: stretch; } .api-url-wrapper input[type="url"] { border-radius: 8px; border-right: 1px solid rgba(0, 0, 0, 0.1); } #fetch-models-btn { border-radius: 8px; border-left: 1px solid rgba(0, 0, 0, 0.1); } .form-grid { gap: 15px; } .form-group input[type="text"], .form-group input[type="url"], .form-group input[type="password"], .form-group textarea, .form-group select { padding: 10px 12px; font-size: 0.95em; } #generate-tno-btn { padding: 10px 20px; font-size: 1em; } }
@media (max-width: 600px) { .tno-screen-container { border-radius: 0; border-left: none; border-right: none; } .event-title-section h1 { font-size: 1.5em; } .newspaper-snippet .snippet-header { font-size: 1.3em; } .quote-overlay { max-width: 90%; font-size: 0.85em; bottom: 8px; right: 8px; padding: 5px 8px;} .quote-overlay p { font-size: 0.8em;} .quote-overlay .attribution { font-size: 0.7em; } .event-main-content { padding: 12px; font-size: 0.85em; line-height: 1.6;} .event-option-button .option-text { font-size: 0.9em; } .event-panel-container { min-height: auto; } .event-image-section img { max-height: 180px;} .left-column { width: 100%; } .leader-portrait img { width: 70px; height: 90px; } .leader-name { font-size: 1.1em; } .nf-main-icon img { width: 40px; height: 40px; } .nf-main-details .title { font-size: 1em; } .nf-main-details .description { font-size: 0.8em; } .spirit-icon { width: 24px; height: 24px; font-size: 12px; } .spirit-description { font-size: 0.8em; } .political-pie-chart { max-width: 100px; } #tno-flag-img { width: 60px; } .stats-text { font-size: 1em; } .newspaper-snippet { font-size: 0.75em; max-height: 100px; } }

/* --- Tooltip Styles --- */
.tno-tooltip {
    position: fixed;
    z-index: 9999;
    display: none;
    font-family: 'Noto Sans SC', sans-serif;
    color: #c8d8e8; /* Lighter blue-ish text for body */
    background-color: rgba(27, 36, 48, 0.9); /* Dark, semi-transparent background */
    border: 1px solid #00bfff; /* Bright cyan border */
    border-radius: 0; /* Sharp corners */
    width: 400px; /* Slightly wider for better text flow */
    pointer-events: none;
    box-shadow: 0 0 15px rgba(0, 191, 255, 0.3); /* Cyan glow */
    padding: 12px;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.tooltip-content-wrapper {
    display: flex;
    flex-direction: column;
}

.tooltip-title {
    font-size: 1.2em;
    font-weight: 700;
    color: #ffffff; /* White title */
    text-align: left; /* Align to the left */
    padding-bottom: 2px;
}

.tooltip-divider {
    border-bottom: 1px dashed #00bfff; /* Bright cyan dashed line */
    margin: 8px 0;
    opacity: 0.6;
}

.tooltip-subtitle {
    font-size: 1.0em;
    font-weight: normal;
    color: #f0f0f0; /* Off-white subtitle */
    text-align: left;
    margin-bottom: 12px;
}

.tooltip-image-container {
    width: 100%;
    max-height: 150px; /* Use max-height to be flexible */
    background-color: #111;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden; /* Hide parts of image if it's not square */
}
.tooltip-image-container.spirit-icon {
    width: 80px; /* Fixed size for spirit icons */
    height: 80px;
    flex-shrink: 0;
    margin-right: 12px;
    margin-bottom: 0; /* Remove bottom margin when next to text */
}
.tooltip-image-container.loading::after {
    content: '⏳';
    position: absolute;
    font-size: 2rem;
    color: #888;
    animation: pulse 1.5s infinite ease-in-out;
}
.tooltip-image-container.error::after {
    content: '❌';
    position: absolute;
    font-size: 2rem;
    color: #a83232;
}

#tooltip-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(15%) contrast(1.05);
    opacity: 0.9;
}

.tooltip-image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.15) 0px, rgba(0, 0, 0, 0.15) 1px, transparent 1px, transparent 3px);
    pointer-events: none;
    z-index: 1;
}

.tooltip-description {
    font-size: 0.95em;
    line-height: 1.6;
    text-align: justify;
    /* Removed max-height and overflow to allow the tooltip to grow */
}

.tooltip-description p {
    margin: 0 0 1em 0;
}
.tooltip-description p:last-child {
    margin-bottom: 0;
}

.tooltip-flavor-text {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px dashed rgba(0, 191, 255, 0.3);
    font-style: italic;
    color: #9ab; /* A slightly different, muted color */
    text-align: right;
}

/* --- Fullscreen Mode Styles --- */
.tno-ui-wrapper:fullscreen {
    /* By setting a fixed aspect ratio (like 1920x1080), the browser will
       automatically letterbox the content to fit the screen, preserving the layout. */
    width: 1920px !important;
    height: 1080px !important;
    /* These values force the element to center within the fullscreen view. */
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    background-color: #000; /* Black background for letterboxing */
}
