* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "VT323", "Courier New", monospace;
  font-size: 1.15rem;
  background-color: #140d1e;
  background-image: url("/static/bg.jpg");
  background-size: cover;
    background-position: right bottom;
  background-repeat: no-repeat;
  color: #f5e6c8;
  min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 28px 12px;
  }

.card {
  background: #241a30;
  border: 2px solid #4a3a5c;
  border-radius: 4px;
  box-shadow: 0 0 0 1px #0a0610, 0 10px 30px rgba(0, 0, 0, 0.55);
  width: 100%;
  max-width: 560px;
  align-self: flex-start;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

/* Desktop window (OneShot WME style) */
.titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1a1226;
  border-bottom: 2px solid #4a3a5c;
  padding: 10px 14px;
  font-family: "Press Start 2P", monospace;
  font-size: 0.85rem;
  color: #ffd27b;
}
.titlebar-controls { display: flex; align-items: center; gap: 12px; color: #7a6a8c; }
.titlebar-controls svg { display: block; }
.titlebar-title { display: flex; align-items: center; gap: 6px; }
.titlebar-icon { width: 18px; height: 18px; display: block; }
.window-body { padding: 26px; }

/* Starfield overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1px 1px at 25% 60%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 40% 15%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 55% 45%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 70% 25%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1.5px 1.5px at 85% 55%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 15% 80%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 60% 75%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1.5px 1.5px at 90% 85%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 35% 90%, rgba(255, 255, 255, 0.6), transparent);
  pointer-events: none;
  z-index: 0;
}

/* Taskbar */
.taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1a1226;
  border-top: 2px solid #4a3a5c;
  padding: 0 14px;
  font-family: "Press Start 2P", monospace;
  font-size: 0.55rem;
  color: #c9b98f;
  z-index: 200;
}
.taskbar-app { color: #ffd27b; }
#clock { color: #c9b98f; }

/* OneShot sun */
.sun {
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  display: block;
  filter: drop-shadow(0 0 10px rgba(255, 165, 0, 0.5));
}

h1 {
  font-family: "Press Start 2P", monospace;
  font-size: 1.05rem;
  line-height: 1.5;
  text-align: center;
  color: #ffd27b;
  text-shadow: 0 2px 0 #7a4a00;
  margin-bottom: 8px;
}
.sub {
  color: #c9b98f;
  text-align: center;
  margin-bottom: 22px;
  font-size: 1.05rem;
}

.nick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.nick-row label { font-weight: 600; white-space: nowrap; color: #ffd27b; }
input[type="text"], input[type="password"] {
  flex: 1;
  background: #140d1e;
  border: 2px solid #4a3a5c;
  border-radius: 4px;
  color: #f5e6c8;
  padding: 9px 12px;
  font-family: "VT323", monospace;
  font-size: 1.1rem;
}
input[type="text"]:focus, input[type="password"]:focus {
  outline: none;
  border-color: #ffa500;
  box-shadow: 0 0 8px rgba(255, 165, 0, 0.3);
}

.option {
  background: #1e1628;
  border: 2px solid #3a2a4a;
  border-radius: 4px;
  padding: 14px;
  margin-bottom: 12px;
}
.option h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  word-break: break-word;
  color: #f5e6c8;
}

.vote-row { display: flex; gap: 6px; }
.vote-row button {
  flex: 1;
  border: 2px solid #4a3a5c;
  background: #2a1e3a;
  color: #f5e6c8;
  border-radius: 4px;
  padding: 8px 0;
  font-family: "Press Start 2P", monospace;
  font-size: 0.8rem;
  text-shadow: 1px 1px 0 currentColor;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  }
  .vote-row button:hover { background: #3a2a52; border-color: #ffa500; }
.vote-row button.active-yes { background: #1f7a3d; border-color: #2ea35a; box-shadow: 0 0 8px rgba(46, 163, 90, 0.4); }
.vote-row button.active-maybe { background: #7a5a1f; border-color: #a3822e; box-shadow: 0 0 8px rgba(163, 130, 46, 0.4); }
.vote-row button.active-no { background: #7a2a2a; border-color: #a33a3a; box-shadow: 0 0 8px rgba(163, 58, 58, 0.4); }
.vote-row button.active-1 { background: #7a2a2a; border-color: #a33a3a; box-shadow: 0 0 8px rgba(163, 58, 58, 0.4); }
.vote-row button.active-2 { background: #7a422a; border-color: #a3622e; box-shadow: 0 0 8px rgba(163, 98, 46, 0.4); }
.vote-row button.active-3 { background: #7a5a1f; border-color: #a3822e; box-shadow: 0 0 8px rgba(163, 130, 46, 0.4); }
.vote-row button.active-4 { background: #4f701f; border-color: #7ea32e; box-shadow: 0 0 8px rgba(126, 163, 46, 0.4); }
.vote-row button.active-5 { background: #1f7a3d; border-color: #2ea35a; box-shadow: 0 0 8px rgba(46, 163, 90, 0.4); }
.undo-btn {
  flex: 0 0 44px;
  width: 44px;
  border: 2px solid #4a3a5c;
  background: #2a1e3a;
  color: #c9b98f;
  border-radius: 4px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.undo-btn svg { display: block; }
.undo-btn:hover { border-color: #ffa500; color: #f5e6c8; }

.counts { margin-top: 10px; font-size: 1rem; color: #c9b98f; }

.add-row { display: flex; gap: 8px; margin-top: 8px; }
.add-row input { flex: 1; }
#add-btn {
  background: #ffa500;
  border: 2px solid #e07b00;
  color: #1b2a3a;
  border-radius: 4px;
  padding: 9px 16px;
  font-family: "Press Start 2P", monospace;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  text-align: center;
}
  #add-btn:hover { background: #ffb347; }

.msg { margin-top: 14px; font-size: 1.05rem; min-height: 1.2em; text-align: center; }
.msg.error { color: #ff8a8a; }
.msg.ok { color: #8affa8; }

.empty { color: #c9b98f; text-align: center; padding: 20px 0; }

/* Admin panel */
.full-btn {
  width: 100%;
  background: #ffa500;
  border: 2px solid #e07b00;
  color: #1b2a3a;
  border-radius: 4px;
  padding: 10px;
  font-family: "Press Start 2P", monospace;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 4px;
}
.full-btn:hover { background: #ffb347; }

.admin-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.admin-head h1 { margin-bottom: 0; }
.ghost-btn {
  background: transparent;
  border: 2px solid #4a3a5c;
  color: #c9b98f;
  border-radius: 4px;
  padding: 6px 12px;
  font-family: "Press Start 2P", monospace;
  font-size: 0.8rem;
  cursor: pointer;
}
.ghost-btn:hover { color: #f5e6c8; border-color: #ffa500; }

.section-title {
  font-family: "Press Start 2P", monospace;
  font-size: 0.7rem;
  color: #ffd27b;
  margin: 24px 0 12px;
}

.totals {
  background: #1e1628;
  border: 2px solid #3a2a4a;
  border-radius: 4px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.stat-row { margin-bottom: 14px; }
.stat-title { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 6px; }
.stat-total { color: #c9b98f; font-weight: 400; font-size: 0.95rem; }
.bar { display: flex; height: 14px; border-radius: 3px; overflow: hidden; background: #140d1e; border: 1px solid #3a2a4a; }
.bar-yes { background: #2ea35a; }
.bar-maybe { background: #a3822e; }
.bar-no { background: #a33a3a; }
.stat-labels { font-size: 0.95rem; color: #c9b98f; margin-top: 4px; }

.rating-bar {
  height: 14px;
  border-radius: 3px;
  background: #140d1e;
  border: 1px solid #3a2a4a;
  overflow: hidden;
  margin-top: 6px;
}
.rating-fill {
  height: 100%;
  background: linear-gradient(90deg, #7ea32e, #ffa500);
}
.c-rate { color: #ffd27b; }

.vote-list { max-height: 260px; overflow-y: auto; border: 2px solid #3a2a4a; border-radius: 4px; }
.vote-item { padding: 7px 12px; border-bottom: 1px solid #2a1e3a; font-size: 1rem; }
.vote-item:last-child { border-bottom: none; }
.vote-time { color: #7a8a9c; font-size: 0.9rem; float: right; }
.c-yes { color: #8affa8; }
.c-maybe { color: #ffd27b; }
.c-no { color: #ff8a8a; }

.admin-option h3 { margin-bottom: 8px; }
.admin-actions { display: flex; gap: 8px; }
.edit-btn, .del-btn {
  border-radius: 4px;
  padding: 6px 14px;
  font-family: "Press Start 2P", monospace;
  font-size: 0.8rem;
  cursor: pointer;
  border: 2px solid #4a3a5c;
  background: #2a1e3a;
  color: #f5e6c8;
}
.edit-btn:hover { border-color: #ffa500; }
.del-btn:hover { border-color: #a33a3a; color: #ff8a8a; }

.footer-link { margin-top: 20px; font-size: 1rem; text-align: center; }
.footer-link a { color: #ffd27b; text-decoration: none; }
.footer-link a:hover { color: #ffa500; }

/* Charts */
.chart-actions { display: flex; gap: 8px; margin-bottom: 12px; }
.chart-wrap {
  background: #1e1628;
  border: 2px solid #3a2a4a;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 8px;
}
.chart-wrap canvas { max-height: 320px; }

a { color: #ffd27b; }
a:hover { color: #ffa500; }

/* Music button */
.music-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid #4a3a5c;
  background: #241a30;
  color: #7a6a8c;
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.music-btn:hover { border-color: #ffa500; color: #ffd27b; }
.music-btn.on {
  color: #ffa500;
  border-color: #ffa500;
  box-shadow: 0 0 16px rgba(255, 165, 0, 0.4);
}

/* Mobile responsiveness */
@media (max-width: 640px) {
  body { padding: 20px 14px; }
  .window-body { padding: 18px 14px; }

  .vote-row button { font-size: 0.7rem; padding: 9px 2px; }
    .undo-btn { flex: 0 0 36px; width: 36px; }
    .vote-row { gap: 6px; }
    .option { padding: 12px 10px; }
    .option h3 { font-size: 1.05rem; }

  .nick-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .nick-row label { text-align: center; }

  .add-row { flex-direction: column; }
  #add-btn { width: 100%; font-size: 0.7rem; }
  .vote-row button { overflow: hidden; }

  .admin-head { flex-direction: column; gap: 10px; }
    .admin-head h1 { font-size: 0.9rem; }
    h1 { font-size: 0.85rem; }
    .section-title { font-size: 0.6rem; }

  .stat-title { flex-direction: column; gap: 2px; }
  .vote-time { float: none; display: block; }

  .music-btn { bottom: 14px; right: 14px; width: 46px; height: 46px; }
}
