/* ==========================================================================
   MILLENNIUM MANIA - Y2K RETRO THEME STYLESHEET
   Authentic Late-90s / Millennium OS GUI Aesthetics
   ========================================================================== */

:root {
  /* Desktop & OS Colors */
  --os-desktop-bg: #bcc4b6;
  --os-window-bg: #c5cbc0;
  --os-window-border: #4d5547;
  --os-titlebar-bg: #003e1c;
  --os-titlebar-text: #ffffff;

  /* Card & Panel Surfaces */
  --card-surface-bg: #ecefe8;
  --card-border: #3b4236;
  --card-highlight: #ffffff;
  
  /* Inset Boxes (Sunken Panels) */
  --inset-bg: #d4dad0;
  --inset-shadow-dark: #727a6d;
  --inset-shadow-mid: #9da698;
  --inset-highlight: #ffffff;

  /* 3D Button Colors */
  --btn-bg: #c6cdc2;
  --btn-text: #1a1e17;
  --btn-highlight: #ffffff;
  --btn-shadow: #596153;
  --btn-shadow-dark: #2c3228;

  /* State Highlight Colors (Calendar & Legend) */
  --state-green: #86efac;
  --state-green-text: #053b19;
  --state-red: #f87171;
  --state-red-text: #450a0a;
  
  /* Text & Typography */
  --font-retro-pixel: 'Pixelify Sans', 'Silkscreen', 'VT323', monospace;
  --font-thai-tech: 'Chakra Petch', 'Bai Jamjuree', sans-serif;
  --font-thai-body: 'Bai Jamjuree', 'Chakra Petch', sans-serif;
}

/* Base Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--os-desktop-bg);
  background-image: 
    radial-gradient(#aeb7a7 15%, transparent 16%),
    radial-gradient(#aeb7a7 15%, transparent 16%);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
  color: #1c2118;
  font-family: var(--font-thai-body);
  font-size: 15px;
  line-height: 1.4;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 14px;
}

/* ==========================================================================
   OS WINDOW CONTAINER (Windows 98 / Millennium Style)
   ========================================================================== */
.os-window {
  width: 100%;
  max-width: 980px;
  background: var(--os-window-bg);
  border: 3px solid var(--os-window-border);
  box-shadow: 
    4px 4px 0px rgba(0, 0, 0, 0.4),
    inset 1px 1px 0px var(--btn-highlight),
    inset -1px -1px 0px var(--btn-shadow);
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

/* Window Titlebar */
.window-titlebar {
  background: var(--os-titlebar-bg);
  color: var(--os-titlebar-text);
  padding: 4px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  border-bottom: 2px solid var(--btn-shadow);
}

.window-title-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-retro-pixel);
  font-size: 14px;
  letter-spacing: 0.5px;
}

.window-title-icon {
  font-size: 14px;
}

.window-rollup-badge {
  display: none;
  font-size: 11px;
  color: #fffa7a;
  background: rgba(0, 0, 0, 0.45);
  padding: 1px 7px;
  border: 1px dashed #fffa7a;
  letter-spacing: 0.5px;
  animation: pulse-rollup-badge 1.2s steps(2) infinite;
}

@keyframes pulse-rollup-badge {
  0% { opacity: 1; }
  50% { opacity: 0.6; }
  100% { opacity: 1; }
}

.window-controls {
  position: relative;
  display: flex;
  align-items: center;
}

.titlebar-controls-img {
  height: 22px;
  width: auto;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  user-select: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
  pointer-events: none;
}

/* Invisible Hitboxes matching the 3 buttons in the 99x27 image */
.ctrl-hitbox {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 33.333%;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  outline: none;
}

.btn-win-min {
  left: 0;
}

.btn-win-max {
  left: 33.333%;
}

.btn-win-close {
  left: 66.666%;
}

.ctrl-hitbox:hover {
  background: rgba(255, 255, 255, 0.18);
}

.ctrl-hitbox:active {
  background: rgba(0, 0, 0, 0.3);
}


.ctrl-btn {
  width: 22px;
  height: 20px;
  background: var(--btn-bg);
  border: 1px solid #1a1e17;
  box-shadow: 
    inset 1px 1px 0px #fff,
    inset -1px -1px 0px #707869;
  font-family: var(--font-retro-pixel);
  font-size: 11px;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: #1a1e17;
  padding: 0;
  transition: transform 0.05s ease;
}

.ctrl-btn:active {
  box-shadow: 
    inset -1px -1px 0px #fff,
    inset 1px 1px 0px #707869;
  transform: translate(1px, 1px);
}

.ctrl-btn.btn-close:hover {
  background: #d9534f;
  color: #ffffff;
}

/* Main Workspace */
.window-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==========================================================================
   DESKTOP HEADER BANNER (Displayed on desktop/tablet above the 2 columns)
   ========================================================================== */
.desktop-header-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 4px;
  position: relative;
}

.banner-logo-col {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.banner-logo-col.left-logo .brand-logo {
  width: 140px;
  height: auto;
  max-height: 70px;
  object-fit: contain;
  filter: drop-shadow(1px 2px 2px rgba(0,0,0,0.15));
}

.banner-logo-col.right-globe .brand-globe {
  width: 75px;
  height: 75px;
  object-fit: contain;
  filter: drop-shadow(1px 2px 2px rgba(0,0,0,0.15));
}

/* Center Arch Badge */
.banner-badge {
  background: var(--card-surface-bg);
  border: 2px solid var(--card-border);
  border-bottom: 2px solid var(--card-border);
  border-radius: 0;
  padding: 8px 36px 6px;
  text-align: center;
  box-shadow: 
    inset 1px 1px 0px #ffffff,
    2px 2px 0px rgba(0,0,0,0.15);
  min-width: 290px;
}

.event-sub-headline {
  font-family: var(--font-thai-tech);
  font-size: 19px;
  font-weight: 700;
  color: #1d251a;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.event-main-title {
  font-family: var(--font-retro-pixel);
  font-size: 26px;
  font-weight: 700;
  color: #0d120a;
  line-height: 1.1;
  letter-spacing: 1px;
}

.event-author {
  font-family: var(--font-retro-pixel);
  font-size: 15px;
  color: #273121;
  margin-top: 2px;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   APP LAYOUT: 2-COLUMN (Desktop / iPad) & 2-PAGE WIZARD (Mobile)
   ========================================================================== */
.app-layout-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 16px;
  align-items: stretch;
}

/* Panel Card Container (ขอบตัด คมชัดสไตล์ Windows 98) */
.panel-card {
  background: var(--card-surface-bg);
  border: 2px solid var(--card-border);
  border-radius: 0;
  padding: 16px;
  box-shadow: 
    inset 1px 1px 0px #ffffff,
    2px 2px 0px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  gap: 12px;
}


/* Section Headings */
.section-title-box {
  margin-bottom: 2px;
}

.section-title {
  font-family: var(--font-thai-tech);
  font-size: 22px;
  font-weight: 700;
  color: #12180f;
  line-height: 1.2;
}

.section-desc {
  font-size: 13px;
  color: #434c3e;
  line-height: 1.35;
  margin-top: 4px;
}

/* Inset Sunken Box (Form & Calendar surfaces) */
.inset-box {
  background: var(--inset-bg);
  border-top: 2px solid var(--inset-shadow-dark);
  border-left: 2px solid var(--inset-shadow-dark);
  border-right: 2px solid var(--inset-highlight);
  border-bottom: 2px solid var(--inset-highlight);
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.18);
  padding: 16px;
}

/* ==========================================================================
   FORM CONTROLS (Personal Info)
   ========================================================================== */
.form-inset-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 240px;
}

#personal-info-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-family: var(--font-retro-pixel);
  font-size: 13px;
  color: #2b3325;
  letter-spacing: 0.5px;
}

.input-row-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.retro-input {
  width: 100%;
  padding: 7px 10px;
  background: #ffffff;
  border-top: 2px solid #5a6353;
  border-left: 2px solid #5a6353;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.15);
  font-family: var(--font-thai-body);
  font-size: 14px;
  color: #111;
  outline: none;
  border-radius: 0;
}

.retro-input:focus {
  background: #fffff6;
  border-top-color: #003e1c;
  border-left-color: #003e1c;
}

.retro-input::placeholder {
  color: #889283;
  font-size: 13px;
}

/* Input Error State (ถ้าลืมอะไรให้ตรงนั้นเป็นสีแดง) */
.retro-input.input-error,
.retro-select.input-error {
  background-color: #fff2f2 !important;
  border-top: 2px solid #d32f2f !important;
  border-left: 2px solid #d32f2f !important;
  border-right: 2px solid #ff7777 !important;
  border-bottom: 2px solid #ff7777 !important;
  box-shadow: 
    inset 1px 1px 2px rgba(211, 47, 47, 0.4),
    0 0 0 1px #d32f2f,
    0 0 6px rgba(211, 47, 47, 0.5) !important;
  animation: input-shake 0.35s ease-in-out;
}

.retro-input.input-error::placeholder {
  color: #d32f2f !important;
  opacity: 0.85;
}

.form-group.has-error .form-label {
  color: #d32f2f !important;
  font-weight: 700 !important;
  text-shadow: 0 0 1px rgba(211, 47, 47, 0.3);
}

.form-group.has-error .room-prefix,
.form-group.has-error .room-slash {
  color: #d32f2f !important;
  font-weight: 700;
}

@keyframes input-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}


/* Room Selector Row */
.room-selector-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-prefix {
  font-family: var(--font-thai-tech);
  font-size: 16px;
  font-weight: 700;
  color: #1a1e17;
}

.room-slash {
  font-family: var(--font-thai-tech);
  font-size: 18px;
  font-weight: 700;
  color: #3b4236;
}

.retro-select {
  padding: 6px 10px;
  background: #ffffff;
  border-top: 2px solid #5a6353;
  border-left: 2px solid #5a6353;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.15);
  font-family: var(--font-thai-body);
  font-size: 15px;
  font-weight: 600;
  color: #111;
  cursor: pointer;
  outline: none;
  border-radius: 0;
}

.grade-input {
  width: 50px;
  text-align: center;
  font-weight: 700;
}

.room-select {
  width: 70px;
}

/* ==========================================================================
   CALENDAR PANEL (เลือกวัน)
   ========================================================================== */
.calendar-inset-box {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.calendar-header-bar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 0 4px 6px 4px;
}

.calendar-month-name {
  font-family: var(--font-retro-pixel);
  font-size: 24px;
  font-weight: 700;
  color: #1a1e17;
  letter-spacing: 0.5px;
}

/* Calendar Weekdays Row (Pixel Art) */
.calendar-weekdays-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-family: var(--font-retro-pixel);
  font-size: 16px;
  font-weight: 600;
  color: #1a1e17;
  padding-bottom: 8px;
  border-bottom: 1px solid #b2b9ad;
}

/* Days 7-Column Grid */
.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 8px;
  column-gap: 2px;
  text-align: center;
  justify-items: center;
  align-items: center;
  padding-top: 6px;
}

/* Compact Date Cell with Pixel Art Numbers */
.cal-day-cell {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-retro-pixel);
  font-size: 17px;
  font-weight: 600;
  color: #1a1e17;
  cursor: pointer;
  border-radius: 50%;
  user-select: none;
  transition: all 0.1s ease;
  position: relative;
  margin: 0 auto;
  box-sizing: border-box;
}

.cal-day-cell:hover:not(.other-month):not(.state-available):not(.state-unavailable) {
  background-color: rgba(0, 0, 0, 0.08);
}

/* Dimmed previous/next month dates (January only is active) */
.cal-day-cell.other-month {
  color: #9ea598;
  cursor: default;
  opacity: 0.55;
  pointer-events: none;
}

/* LOCKED DAYS (1, 2, 3 January - ห้ามเลือก) */
.cal-day-cell.locked-day {
  color: #a0a69a;
  cursor: not-allowed;
  opacity: 0.5;
  text-decoration: line-through;
  background-color: rgba(0, 0, 0, 0.05);
}

/* STATE 1: สะดวก (Green Circle with Figma Inner Shadow) */
.cal-day-cell.state-available {
  background-color: #71e888 !important;
  color: #111111 !important;
  font-weight: 700;
  border-radius: 50%;
  box-shadow: 
    inset 2px 2px 4px rgba(0, 0, 0, 0.35),
    inset -1px -1px 2px rgba(255, 255, 255, 0.5) !important;
  animation: win98-snap-select 0.08s ease-out;
}

/* STATE 2: ไม่สะดวก (Red Circle with Figma Inner Shadow) */
.cal-day-cell.state-unavailable {
  background-color: #ff6f69 !important;
  color: #111111 !important;
  font-weight: 700;
  border-radius: 50%;
  box-shadow: 
    inset 2px 2px 4px rgba(0, 0, 0, 0.4),
    inset -1px -1px 2px rgba(255, 255, 255, 0.35) !important;
  animation: win98-snap-select 0.08s ease-out;
}

/* Windows 98 Snappy Date Click Animation */
@keyframes win98-snap-select {
  0% { transform: translate(1px, 1px); }
  50% { transform: translate(1px, 1px); }
  100% { transform: translate(0, 0); }
}

/* Footer of Calendar (Legend + Vote Button) */
.calendar-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 4px;
}

.calendar-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Legend dots with exact Figma Inner Shadow */
.legend-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-red {
  background-color: #ff6f69;
  border: none;
  box-shadow: 
    inset 1.5px 1.5px 3px rgba(0, 0, 0, 0.4),
    inset -1px -1px 2px rgba(255, 255, 255, 0.35);
}

.dot-green {
  background-color: #71e888;
  border: none;
  box-shadow: 
    inset 1.5px 1.5px 3px rgba(0, 0, 0, 0.35),
    inset -1px -1px 2px rgba(255, 255, 255, 0.5);
}

.legend-text {
  font-size: 13px;
  font-weight: 600;
  color: #273022;
}

/* 3D Retro Windows 98 Buttons */
.retro-btn {
  background: var(--btn-bg);
  border-top: 2px solid var(--btn-highlight);
  border-left: 2px solid var(--btn-highlight);
  border-right: 2px solid #000000;
  border-bottom: 2px solid #000000;
  box-shadow: 
    inset 1px 1px 0px #ffffff,
    inset -1px -1px 0px var(--btn-shadow);
  color: var(--btn-text);
  font-family: var(--font-retro-pixel);
  cursor: pointer;
  user-select: none;
  text-align: center;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: none; /* Instant Windows 98 reaction */
  border-radius: 0;
  position: relative;
}

.retro-btn:focus-visible {
  outline: 1px dotted #000000;
  outline-offset: -4px;
}

.retro-btn:hover {
  background: #d0d7cb;
}

.retro-btn:active {
  border-top: 2px solid #000000;
  border-left: 2px solid #000000;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  box-shadow: 
    inset 1px 1px 0px var(--btn-shadow),
    inset -1px -1px 0px #ffffff;
  transform: translate(1px, 1px);
}

.btn-vote {
  font-size: 18px;
  font-weight: 700;
  padding: 10px 34px;
  letter-spacing: 1px;
}

.btn-next {
  font-size: 16px;
  font-weight: 700;
  padding: 8px 32px;
  margin: 8px auto 0;
  letter-spacing: 0.5px;
}

.btn-back {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  font-family: var(--font-thai-tech);
}

.mobile-step-actions {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

.mobile-back-row {
  display: none;
  margin-top: 8px;
}

/* ==========================================================================
   RETRO MEDIA PLAYER (Winamp / Stereo / QuickTime Style)
   ========================================================================== */
.retro-media-player {
  background: #c5cbc0;
  border: 2px solid #4a5244;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #33392e;
  border-bottom: 2px solid #33392e;
  box-shadow: 
    inset 1px 1px 0px #ffffff,
    2px 2px 4px rgba(0, 0, 0, 0.25);
  padding: 14px 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Screw Rivets in the 4 corners (⨂) */
.player-screw {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #aeb5a8;
  border: 1px solid #586052;
  box-shadow: inset 1px 1px 0px #fff, inset -1px -1px 0px #333;
}

.player-screw::before {
  content: '✕';
  position: absolute;
  font-size: 8px;
  line-height: 10px;
  width: 100%;
  text-align: center;
  color: #3b4335;
  font-weight: bold;
}

.screw-tl { top: 4px; left: 4px; }
.screw-tr { top: 4px; right: 4px; }
.screw-bl { bottom: 4px; left: 4px; }
.screw-br { bottom: 4px; right: 4px; }

/* LCD / LED Display Screen */
.player-screen {
  background: #000000;
  border-top: 2px solid #333;
  border-left: 2px solid #333;
  border-right: 2px solid #777;
  border-bottom: 2px solid #777;
  padding: 8px 12px;
  overflow: hidden;
  white-space: nowrap;
  box-shadow: inset 0 0 8px rgba(0, 255, 100, 0.15);
  cursor: pointer;
}

.screen-ticker-track {
  display: inline-block;
  white-space: nowrap;
  animation: marquee-scroll 16s steps(100, end) infinite;
}

.ticker-text {
  font-family: var(--font-retro-pixel);
  font-size: 13px;
  color: #38ef7d;
  text-shadow: 0 0 4px rgba(56, 239, 125, 0.7);
  letter-spacing: 1px;
}

@keyframes marquee-scroll {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* Audio Slider Track & Duration Display */
.player-slider-wrapper {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}

.player-slider-track {
  height: 12px;
  background: #8e9588;
  border-top: 2px solid #4a5144;
  border-left: 2px solid #4a5144;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  position: relative;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

.player-slider-fill {
  height: 100%;
  width: 0%;
  background: #506450;
  transition: width 0.15s linear;
  pointer-events: none;
}

.player-slider-thumb {
  position: absolute;
  top: -4px;
  left: 0%;
  width: 14px;
  height: 18px;
  background: #d8ded3;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #333;
  border-bottom: 1px solid #333;
  box-shadow: 1px 1px 2px rgba(0,0,0,0.4);
  transform: translateX(-50%);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.player-slider-thumb:active,
.player-slider-thumb.scrubbing {
  cursor: grabbing !important;
  background: #c3cab9;
  box-shadow: inset 1px 1px 1px #333, inset -1px -1px 1px #fff;
}

.player-time-display-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-retro-pixel);
  font-size: 11px;
  color: #273822;
  font-weight: 700;
  padding: 0 2px;
  user-select: none;
  letter-spacing: 0.5px;
}

.player-time-text {
  display: inline-block;
}

/* Controls & YouTube loader */
.player-controls-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.player-playback-btns {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.player-btn {
  width: 32px;
  height: 28px;
  background: var(--btn-bg);
  border: 1px solid #222;
  box-shadow: 
    inset 1px 1px 0px #fff,
    inset -1px -1px 0px #555;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a1e17;
}

.player-btn:active, .player-btn.active {
  box-shadow: 
    inset -1px -1px 0px #fff,
    inset 1px 1px 0px #555;
  background: #b2b8ad;
  transform: translate(1px, 1px);
}

.player-link-loader {
  display: flex;
  flex-grow: 1;
  gap: 6px;
}

.youtube-link-input {
  flex-grow: 1;
  font-size: 12px;
  padding: 5px 8px;
}

.btn-load {
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Audio-Only YouTube Container: Zero visual footprint, purely off-screen for audio streaming */
#youtube-embed-container {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0.001 !important;
  pointer-events: none !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  z-index: -9999 !important;
}


/* ==========================================================================
   WINDOW STATUS BAR (Bottom)
   ========================================================================== */
.window-statusbar {
  background: var(--os-window-bg);
  border-top: 2px solid var(--btn-highlight);
  padding: 4px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-retro-pixel);
  font-size: 11px;
  color: #3b4236;
  border-top: 1px solid #7c8576;
}

.status-col {
  padding: 2px 6px;
  border-top: 1px solid #777;
  border-left: 1px solid #777;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
}

.status-main {
  flex-grow: 1;
  margin-right: 6px;
}

/* ==========================================================================
   MOBILE-ONLY INNER HEADER
   ========================================================================== */
.mobile-card-header {
  display: none;
  margin-bottom: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid #bac2b3;
}

.mobile-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mobile-logo {
  width: 70px;
  height: auto;
  object-fit: contain;
}

.mobile-globe {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.mobile-header-titles {
  text-align: center;
  flex-grow: 1;
}

.mobile-sub-headline {
  font-family: var(--font-thai-tech);
  font-size: 17px;
  font-weight: 700;
  color: #1d251a;
  line-height: 1.2;
}

.mobile-main-title {
  font-family: var(--font-retro-pixel);
  font-size: 20px;
  font-weight: 700;
  color: #0d120a;
}

.mobile-author {
  font-family: var(--font-retro-pixel);
  font-size: 13px;
  color: #384232;
}

/* ==========================================================================
   VOTE RESULT MODAL (Win98 / Millennium Dialog)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  animation: win98-modal-appear 0.08s steps(2, end);
}

@keyframes win98-modal-appear {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.modal-window {
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--os-window-bg);
  border: 3px solid #000000;
  box-shadow: 
    4px 4px 0px rgba(0, 0, 0, 0.55),
    inset 1px 1px 0px #ffffff,
    inset -1px -1px 0px #808080;
  display: flex;
  flex-direction: column;
  animation: win98-win-pop 0.1s steps(3, end);
}

@keyframes win98-win-pop {
  0% { transform: scale(0.96); }
  100% { transform: scale(1); }
}

.modal-titlebar {
  background: var(--os-titlebar-bg);
  color: #ffffff;
  padding: 4px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-retro-pixel);
  font-size: 13px;
}

.modal-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-header-announcement {
  display: flex;
  gap: 12px;
  align-items: center;
}

.modal-stamp-icon {
  font-size: 32px;
  filter: drop-shadow(1px 2px 2px rgba(0,0,0,0.2));
}

.modal-head-text h3 {
  font-family: var(--font-thai-tech);
  font-size: 19px;
  font-weight: 700;
  color: #12180f;
}

.modal-head-text p {
  font-size: 13px;
  color: #3f473b;
}

.modal-summary-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 15px;
}

.sum-label {
  font-family: var(--font-thai-tech);
  font-weight: 700;
  min-width: 130px;
  color: #222a1e;
  flex-shrink: 0;
}

.sum-val {
  color: #0b1108;
  font-weight: 600;
  word-break: break-word;
}

.dates-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.date-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 0;
  font-size: 13px;
  font-weight: 700;
}


.date-pill.pill-green {
  background: var(--state-green);
  color: var(--state-green-text);
  border: 1px solid #4ade80;
}

.date-pill.pill-red {
  background: var(--state-red);
  color: var(--state-red-text);
  border: 1px solid #f87171;
}

.no-selection-badge {
  color: #798274;
  font-style: italic;
  font-size: 14px;
}

/* Modal Mini Calendar Summary */
.modal-calendar-box {
  background: #d4dad0;
  border-top: 2px solid #727a6d;
  border-left: 2px solid #727a6d;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 4px;
  border-bottom: 1px solid #b6bdaf;
}

.modal-cal-title {
  font-family: var(--font-retro-pixel);
  font-size: 14px;
  font-weight: 700;
  color: #1a1e17;
}

.modal-cal-legend {
  display: flex;
  align-items: center;
  gap: 4px;
}

.modal-leg-txt {
  font-size: 11px;
  font-weight: 600;
  color: #2b3325;
  margin-right: 6px;
}

.modal-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-family: var(--font-retro-pixel);
  font-size: 11px;
  font-weight: 600;
  color: #2e3828;
  padding-bottom: 2px;
}

.modal-cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 5px;
  column-gap: 2px;
  text-align: center;
  justify-items: center;
  align-items: center;
}

.modal-day-cell {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-retro-pixel);
  font-size: 13px;
  font-weight: 600;
  color: #1a1e17;
  border-radius: 50%;
  margin: 0 auto;
  box-sizing: border-box;
}

.modal-day-cell.other-month,
.modal-day-cell.locked-day {
  color: #a4aaa0;
  opacity: 0.45;
}

.modal-day-cell.state-available {
  background-color: #71e888 !important;
  color: #111111 !important;
  font-weight: 700;
  box-shadow: 
    inset 1.5px 1.5px 3px rgba(0, 0, 0, 0.35),
    inset -1px -1px 2px rgba(255, 255, 255, 0.5) !important;
}

.modal-day-cell.state-unavailable {
  background-color: #ff6f69 !important;
  color: #111111 !important;
  font-weight: 700;
  box-shadow: 
    inset 1.5px 1.5px 3px rgba(0, 0, 0, 0.4),
    inset -1px -1px 2px rgba(255, 255, 255, 0.35) !important;
}

.retro-hr {
  border: 0;
  border-top: 1px solid #8f978a;
  border-bottom: 1px solid #ffffff;
  margin: 4px 0;
}

.modal-actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.btn-modal-ok {
  padding: 8px 24px;
  font-size: 15px;
  font-weight: 700;
  background: #a9deb4;
}

.btn-modal-edit, .btn-modal-copy {
  padding: 8px 14px;
  font-size: 13px;
  font-family: var(--font-thai-tech);
  font-weight: 600;
}

/* Windows 98 ToolTip Toast */
.retro-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: #ffffe1;
  color: #000000;
  border: 1px solid #000000;
  padding: 6px 14px;
  font-family: var(--font-thai-body);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.08s steps(2, end);
  z-index: 10000;
}

.retro-toast.show {
  opacity: 1;
}

/* ==========================================================================
   RESPONSIVE DESIGN: MOBILE VS DESKTOP / IPAD
   ========================================================================== */

/* IPAD & DESKTOP (Width >= 768px): 
   - 2-Column layout side-by-side
   - Left: Info + Media Player
   - Right: Calendar */
@media (min-width: 768px) {
  .app-layout-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  /* Keep both panels visible simultaneously */
  #panel-personal-info, #panel-calendar {
    display: flex !important;
  }

  /* Hide mobile-specific headers and buttons on desktop */
  .mobile-card-header,
  .mobile-step-actions,
  .mobile-back-row {
    display: none !important;
  }

  /* Place media player under left column */
  .retro-media-player {
    grid-column: 1 / 2;
    margin-top: -4px;
  }
}

/* MOBILE (< 768px):
   - 2-Step Wizard (Page 1: ข้อมูลส่วนตัว -> Page 2: calendar)
   - Desktop Header Banner hidden, replaced by in-card header */
@media (max-width: 767px) {
  body {
    padding: 6px;
  }

  .os-window {
    border-width: 2px;
  }

  .window-body {
    padding: 10px;
    gap: 12px;
  }

  /* Hide Desktop Top Banner on Mobile to match screenshot 1 & 2! */
  .desktop-header-banner {
    display: none;
  }

  /* Show In-Card Header on Mobile */
  .mobile-card-header {
    display: block;
  }

  .app-layout-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Mobile Wizard Pages: Managed via JS (.mobile-active-step) */
  .app-layout-grid.mobile-step-1 #panel-personal-info {
    display: flex !important;
  }

  .app-layout-grid.mobile-step-1 #panel-calendar {
    display: none !important;
  }

  .app-layout-grid.mobile-step-2 #panel-personal-info {
    display: none !important;
  }

  .app-layout-grid.mobile-step-2 #panel-calendar {
    display: flex !important;
  }

  /* Show Back button on mobile step 2 */
  .app-layout-grid.mobile-step-2 .mobile-back-row {
    display: flex;
    justify-content: flex-start;
  }

  .input-row-duo {
    grid-template-columns: 1fr;
  }

  .calendar-weekdays-grid {
    font-size: 14px;
  }

  .cal-day-cell {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }

  .calendar-footer-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .calendar-legend {
    flex-direction: row;
    justify-content: space-around;
  }

  .btn-vote {
    width: 100%;
  }

  .player-controls-row {
    flex-direction: column;
    align-items: stretch;
  }

  .player-playback-btns {
    justify-content: center;
  }

  .modal-actions-row {
    flex-direction: column;
  }
}

/* ==========================================================================
   WINDOW CONTROL STATES: ROLL-UP (ม้วนหน้าจอ), MAXIMIZE (เต็มจอ), CRT BLACKOUT (หน้าจอดำ)
   ========================================================================== */

/* 1. Window Roll-Up Mode (WindowShade / ม้วนหน้าจอ) */
.os-window.window-rolled-up {
  min-height: auto !important;
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.4) !important;
  margin-bottom: 20px !important;
}

.os-window.window-rolled-up .window-titlebar {
  cursor: pointer;
  border-bottom: 2px solid var(--card-border);
}

.os-window.window-rolled-up .window-rollup-badge {
  display: inline-block;
}

.os-window.window-rolled-up .window-body,
.os-window.window-rolled-up .window-statusbar {
  max-height: 0 !important;
  opacity: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  transform: scaleY(0);
  transform-origin: top;
  pointer-events: none;
  transition: 
    max-height 0.4s cubic-bezier(0.25, 1, 0.5, 1),
    transform 0.4s cubic-bezier(0.25, 1, 0.5, 1),
    opacity 0.25s ease,
    padding 0.3s ease;
}

.os-window:not(.window-rolled-up) .window-body,
.os-window:not(.window-rolled-up) .window-statusbar {
  transition: 
    max-height 0.45s cubic-bezier(0.25, 1, 0.5, 1),
    transform 0.45s cubic-bezier(0.25, 1, 0.5, 1),
    opacity 0.35s ease,
    padding 0.35s ease;
  transform: scaleY(1);
  transform-origin: top;
}

/* 2. Window Maximize Mode (กดเต็มจอก็เต็มจอ) */
.os-window.window-maximized {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  min-height: 100vh !important;
  margin: 0 !important;
  border-radius: 0 !important;
  z-index: 9999 !important;
  display: flex !important;
  flex-direction: column !important;
  box-shadow: none !important;
}

.os-window.window-maximized .window-body {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  height: auto !important;
  max-height: calc(100vh - 65px) !important;
}

/* 3. Authentic Windows 98 Shutdown Experience (LOGOW.SYS & LOGOS.SYS) */
.crt-blackout-screen {
  position: fixed;
  inset: 0;
  background: #000000;
  z-index: 99999999;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
}

.crt-blackout-screen.active {
  display: flex;
}

.crt-scanlines {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.45) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  opacity: 0.75;
}

/* Cathode Ray Tube Beam Collapse Animation on Turn Off */
.crt-shutoff-beam {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 3px;
  background: #ffffff;
  box-shadow: 0 0 20px #ffffff, 0 0 35px #ffffff;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) scaleX(0);
}

.crt-blackout-screen.active .crt-shutoff-beam {
  animation: crt-collapse 0.45s ease-out forwards;
}

@keyframes crt-collapse {
  0% {
    opacity: 1;
    transform: translateY(-50%) scaleX(1) scaleY(300);
  }
  30% {
    opacity: 1;
    transform: translateY(-50%) scaleX(1) scaleY(3);
  }
  70% {
    opacity: 1;
    transform: translateY(-50%) scaleX(0.04) scaleY(2);
  }
  100% {
    opacity: 0;
    transform: translateY(-50%) scaleX(0) scaleY(0);
  }
}

/* Windows 98 Shutdown Phases Container */
.win98-shutdown-phase {
  position: relative;
  z-index: 10;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 960px;
  text-align: center;
  padding: 24px;
  box-sizing: border-box;
}

/* Phase 1: Windows is shutting down... (LOGOW.SYS) */
.crt-blackout-screen.active-shutting .win98-phase-shutting-down {
  display: flex;
  animation: win98-phase-fade 0.35s ease-out forwards;
}

/* Phase 2: It's now safe to turn off your computer (LOGOS.SYS) */
.crt-blackout-screen.active-safe .win98-phase-safe {
  display: flex;
  animation: win98-phase-fade 0.45s ease-out forwards;
}

@keyframes win98-phase-fade {
  0% { opacity: 0; transform: scale(0.97); }
  100% { opacity: 1; transform: scale(1); }
}

/* Windows 98 Brand Emblem */
.win98-brand-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 28px;
}

.win98-flag-svg {
  filter: drop-shadow(2px 3px 5px rgba(0, 0, 0, 0.8));
}

.win98-logo-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.win98-corp {
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.6px;
  line-height: 1.1;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.win98-reg {
  font-size: 9px;
  vertical-align: super;
  margin-left: 1px;
}

.win98-os {
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 34px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
  line-height: 1;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
}

.win98-ver {
  color: #ff4422;
  font-style: italic;
  font-weight: 900;
  margin-left: 4px;
}

.win98-shutting-title {
  font-family: 'Segoe UI', Tahoma, 'MS Sans Serif', sans-serif;
  font-size: 24px;
  font-weight: bold;
  color: #ffffff;
  margin: 0 0 8px 0;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.5px;
}

.win98-shutting-sub {
  font-family: 'Segoe UI', Tahoma, 'MS Sans Serif', sans-serif;
  font-size: 14px;
  color: #c0c0c0;
  margin: 0 0 28px 0;
  letter-spacing: 0.3px;
}

/* Classic Sunken Progress Frame & 3 Moving Blocks */
.win98-progress-frame {
  width: 270px;
  max-width: 85vw;
  height: 20px;
  background: #000000;
  border: 2px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.win98-progress-track {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 0;
  display: flex;
  gap: 3px;
  animation: win98-bar-bounce 1.5s ease-in-out infinite alternate;
}

.win98-bar-block {
  width: 14px;
  height: 100%;
  background: #00aaaa;
  box-shadow: inset 1px 1px #80ffff, inset -1px -1px #005555;
}

@keyframes win98-bar-bounce {
  0% { transform: translateX(3px); }
  100% { transform: translateX(215px); }
}

/* Phase 2: LOGOS.SYS Safe to Turn Off Screen */
.win98-safe-brand-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.win98-flag-svg-mini {
  filter: drop-shadow(1px 2px 3px rgba(0, 0, 0, 0.9));
}

.win98-safe-brand-text {
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
}

.win98-reg-mini {
  font-size: 9px;
  vertical-align: super;
}

/* The Legendary Curved Red-Orange Ribbon Banner */
.win98-ribbon-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 16px 0 34px 0;
}

.win98-orange-banner {
  width: 100%;
  max-width: 860px;
  padding: 16px 28px;
  background: linear-gradient(90deg, 
    rgba(140, 20, 0, 0) 0%, 
    rgba(215, 45, 0, 0.9) 12%, 
    #eb4400 32%, 
    #ff5a00 50%, 
    #eb4400 68%, 
    rgba(215, 45, 0, 0.9) 88%, 
    rgba(140, 20, 0, 0) 100%
  );
  border-top: 2px solid rgba(255, 140, 60, 0.85);
  border-bottom: 2px solid rgba(120, 20, 0, 0.85);
  box-shadow: 0 0 25px rgba(235, 70, 0, 0.5);
  text-align: center;
  box-sizing: border-box;
}

.win98-safe-heading {
  font-family: 'Times New Roman', Times, 'Georgia', 'MS Serif', serif;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(20px, 4vw, 36px);
  color: #ffea75;
  text-shadow: 2px 2px 0px #631200, 3px 3px 6px rgba(0, 0, 0, 0.85);
  letter-spacing: 0.6px;
  margin: 0;
  line-height: 1.3;
}

.win98-safe-actions {
  margin-top: 10px;
}

/* Windows 98 Authentic Restart Button */
.win98-restart-button {
  background: #c0c0c0 !important;
  color: #000000 !important;
  font-family: 'MS Sans Serif', Tahoma, 'VT323', monospace !important;
  font-size: 15px !important;
  font-weight: bold !important;
  border: 2px solid !important;
  border-color: #ffffff #808080 #808080 #ffffff !important;
  box-shadow: inset 1px 1px #dfdfdf, inset -1px -1px #000000 !important;
  padding: 8px 24px !important;
  border-radius: 0 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  transition: background 0.1s ease !important;
}

.win98-restart-button:hover {
  background: #d4d0c8 !important;
}

.win98-restart-button:active {
  border-color: #808080 #ffffff #ffffff #808080 !important;
  box-shadow: inset 1px 1px #000000, inset -1px -1px #dfdfdf !important;
  transform: translate(1px, 1px);
}

.win98-power-sym {
  font-size: 16px;
  color: #008000;
  font-weight: bold;
}

.win98-safe-hint {
  font-family: var(--font-thai-primary);
  font-size: 13px;
  color: #887766;
  margin-top: 20px;
}

/* CRT Degauss Flash when waking up / turning on */
.crt-blackout-screen.degauss-flash {
  animation: crt-degauss 0.45s ease-out forwards;
}

@keyframes crt-degauss {
  0% { filter: brightness(4) invert(0.9); }
  50% { filter: brightness(1.6) contrast(1.6); }
  100% { filter: brightness(1) contrast(1); }
}

