/* ------------------  THEME  ------------------ */
:root {
  --bg-color:#111;
  --text-color:#fff;
  --border:#444;
  --input-bg:#ccc;
  --input-text:#000;
  --flow-bg:#000;
  --accent:red;
  --footer-color:#FFD700;
  --footer-link-color:#FFD700;
  --input-height:130px; /* Base textarea height */
}

[data-theme="light"] {
  --bg-color:#f5f5f5;
  --text-color:#000;
  --border:#aaa;
  --input-bg:#fff;
  --input-text:#111;
  --flow-bg:#f0f0f0;
  --accent:#0077ff;
  --footer-color:#000;
  --footer-link-color:blue;
}

/* ------------------  BASE LAYOUT  ------------------ */
body {
  margin:0;
  padding:0;
  background:var(--bg-color);
  color:var(--text-color);
  font-family:"Arial",sans-serif;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  align-items:center;
}

h1 {
  text-align:center;
  margin:10px 0;
  font-size:2rem;
}

.container {
  width:95%;
  max-width:900px;
  text-align:center;
  position:relative;
  flex:1 0 auto;
}

/* ------------------  TOP BAR  ------------------ */
.top-bar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  width:100%;
  margin-bottom:10px;
  flex-wrap:wrap;
  gap:8px;
}

input[type="file"],
button,
select,
input[type="number"],
input[type="range"] {
  padding:8px 15px;
  border-radius:5px;
  border:2px solid var(--border);
  background:var(--bg-color);
  color:var(--text-color);
  cursor:pointer;
  font-size:15px;
  transition:all .25s ease;
}

input[type="file"]:hover,
button:hover,
select:hover,
input[type="number"]:hover,
input[type="range"]:hover {
  background:var(--border);
}

/* ------------------  TEXT AREA  ------------------ */
#textInput {
  width:100%;
  height:var(--input-height);
  padding:10px 20px;
  box-sizing:border-box;
  white-space:pre-wrap;
  overflow-x:hidden;
  font-size:16px;
  border-radius:5px;
  border:2px solid var(--border);
  margin-bottom:10px;
  background:var(--input-bg);
  color:var(--input-text);
  text-align:left;
}

/* ------------------  FLOW & RSVP  ------------------ */
#flowScreen,
#rsvpScreen {
  width:100%;
  position:relative;
  margin-top:20px;
  transition:opacity .3s ease, height .3s ease;
}

#rsvpScreen { display:none; }
#rsvpScreen.active-screen { display:flex; }
#flowScreen.active-screen { display:flex; }

.marquee-viewport,
.marquee-rsvp {
  position:relative;
  overflow:hidden;
  height:var(--input-height);
  border:2px solid var(--border);
  margin:20px 0;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  white-space:nowrap;
  background:var(--flow-bg);
}

#marquee {
  display:inline-block;
  white-space:nowrap;
  will-change:transform;
}

.flow-line {
  position:absolute;
  top:0;
  bottom:0;
  width:2px;
  background:var(--accent);
  opacity:.5;
  pointer-events:none;
  z-index:2;
}

.flow-line.left-2 { left:35%; }
.flow-line.left-1 { left:45%; }
.flow-line.right-1 { left:55%; }
.flow-line.right-2 { left:65%; }
.flow-line.right-3 { left:75%; }

.word { display:inline-block; padding:0 2px; }
.word.active { background:#FFD580; color:#000; }

/* ------------------  CONTROLS  ------------------ */
.control-group {
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:10px;
  margin-bottom:10px;
  align-items:center;
}

.playback-buttons {
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap:15px;
  margin-top:15px;
  margin-bottom:25px;
  z-index:10;
}

.playback-buttons button {
  background:var(--border);
  color:var(--text-color);
  border:2px solid var(--border);
  padding:10px 20px;
  font-size:15px;
  font-weight:500;
  border-radius:10px;
  cursor:pointer;
  transition:all .25s ease;
  box-shadow:0 2px 5px rgba(0,0,0,.2);
}

.playback-buttons button:hover {
  background:var(--accent);
  color:#000;
  transform:translateY(-3px);
  box-shadow:0 4px 12px rgba(0,0,0,.4);
}

#pauseBtn { background:#ffcc00; color:#000; }
#pauseBtn:hover { background:#ffd633; }
#startOverBtn { background:#d9534f; color:#fff; }
#startOverBtn:hover { background:#ff6b66; }
#loadBtn { background:var(--accent); color:#000; font-weight:600; }
#loadBtn:hover { background:#fff; color:#000; }

/* ------------------  FOOTER  ------------------ */
footer.footer {
  position:fixed;
  bottom:0;
  left:0;
  width:100%;
  background:var(--bg-color);
  color:var(--footer-color);
  border-top:1px solid var(--border);
  text-align:center;
  font-size:13px;
  padding:4px 8px;
  line-height:1;
  z-index:1000;
  box-sizing:border-box;
  backdrop-filter:blur(6px);
  white-space:nowrap;
  overflow-x:auto;
  margin:0;
}


footer.footer .footer-links { display:inline; }
footer.footer .footer-links a {
  color:var(--footer-link-color);
  text-decoration:none;
  margin:0 6px;
}
footer.footer .footer-links a:hover { text-decoration:underline; }

footer.footer .footer-copy,
footer.footer .footer-credit {
  margin:0 6px;
  color:var(--footer-color);
  opacity:.85;
}

footer.footer .footer-credit a {
  color:var(--footer-link-color);
  text-decoration:none;
}
footer.footer .footer-credit a:hover { text-decoration:underline; }

footer.footer .footer-divider { margin:0 5px; opacity:.4; }

@media(max-width:600px) {
  footer.footer { font-size:12px; padding:6px 6px; line-height:1.1; }
  footer.footer .footer-links a { margin:0 4px; }
}

/* ------------------  FOCUS MODE (Hide Screen) ------------------ */
body.focus-mode .top-bar,
body.focus-mode textarea,
body.focus-mode footer.footer,
body.focus-mode .control-group,
body.focus-mode h1 {
  display:none !important;
}

body.focus-mode #flowScreen,
body.focus-mode #rsvpScreen {
  display:none !important;
}

body.focus-mode #flowScreen.active-screen,
body.focus-mode #rsvpScreen.active-screen {
  display:flex !important;
  justify-content:center;
  align-items:center;
  height:calc(var(--input-height) * 2);
  border:2px solid var(--border);
  background:var(--flow-bg);
  opacity:1;
  z-index:5;
}

body.focus-mode .playback-buttons {
  display:flex !important;
  justify-content:center;
  gap:15px;
  margin-top:15px;
  position:relative;
  z-index:10;
  background:transparent;
}

/* ------------------  ACCESSIBLE & COLOR-BLIND MODES ------------------ */
body.accessible-mode {
  --bg-color:#ffffff;
  --text-color:#000000;
  --border:#000000;
  --input-bg:#ffffff;
  --input-text:#000000;
  --flow-bg:#ffffff;
  --accent:#ffcc00;
  font-size:18px;
  letter-spacing:0.5px;
}

body.colorblind-deuteranopia {
  --bg-color:#fafafa;
  --text-color:#000;
  --border:#000;
  --input-bg:#ffffff;
  --input-text:#000;
  --flow-bg:#ffffff;
  --accent:#0066cc;
  font-size:18px;
}

body.colorblind-protanopia {
  --bg-color:#f9f9f9;
  --text-color:#000;
  --border:#000;
  --input-bg:#ffffff;
  --input-text:#000;
  --flow-bg:#ffffff;
  --accent:#00aaff;
  font-size:18px;
}

body.colorblind-tritanopia {
  --bg-color:#fefefe;
  --text-color:#000;
  --border:#000;
  --input-bg:#ffffff;
  --input-text:#000;
  --flow-bg:#ffffff;
  --accent:#ff6600;
  font-size:18px;
}

body.accessible-mode *,
body.colorblind-deuteranopia *,
body.colorblind-protanopia *,
body.colorblind-tritanopia *:focus {
  outline:3px solid var(--accent) !important;
  outline-offset:2px;
}

body.accessible-mode button,
body.colorblind-deuteranopia button,
body.colorblind-protanopia button,
body.colorblind-tritanopia button {
  background:#fff !important;
  color:#000 !important;
  border:2px solid #000 !important;
}

body.accessible-mode button:hover,
body.colorblind-deuteranopia button:hover,
body.colorblind-protanopia button:hover,
body.colorblind-tritanopia button:hover {
  background:var(--accent) !important;
  color:#000 !important;
}

body.accessible-mode a,
body.colorblind-deuteranopia a,
body.colorblind-protanopia a,
body.colorblind-tritanopia a {
  color:#000 !important;
  text-decoration:underline;
}

/* ------------------  CONSENT BANNER  ------------------ */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0,0,0,0.85);
  color: #fff;
  text-align: center;
  padding: 12px;
  font-size: 14px;
  border-top: 2px solid #444;
  z-index: 3000;
  display: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.cookie-consent.show {
  display: block !important;
  opacity: 1;
}

.cookie-consent button {
  margin: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

#acceptCookies {
  background: #ffcc00;
  color: #000;
  border: none;
}

#rejectCookies {
  background: #333;
  color: #fff;
  border: 1px solid #777;
}

/* ------------------ PAYWALL OVERLAY ------------------ */
.paywall-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 5000;
  text-align: center;
  padding: 20px;
}

.paywall-content {
  background: #111;
  border: 2px solid #ffcc00;
  border-radius: 12px;
  padding: 30px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 0 20px rgba(255, 204, 0, 0.4);
}

.paywall-content h2 {
  color: #ffcc00;
  margin-bottom: 10px;
}

.paywall-content p {
  font-size: 15px;
  line-height: 1.4;
  margin-bottom: 20px;
}

.paywall-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.paywall-buttons button {
  padding: 10px 20px;
  font-size: 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

#watchAdBtn {
  background: #00bfff;
  color: #fff;
}

#subscribeBtn {
  background: #ffcc00;
  color: #000;
  font-weight: bold;
}

#closePaywall {
  background: #333;
  color: #fff;
}

.paywall-buttons button:hover {
  transform: scale(1.05);
}
