@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

body {
  background: #000;
  color: #0f0;
  font-family: 'Press Start 2P', monospace;
  margin: 0;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  overflow-x: hidden;
}

h1 {
  font-size: 2rem;
  margin-bottom: 2rem;
  margin-top: 2rem;
  color: #0f0;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: 2px;
  max-width: 100%;
  padding: 0 1rem;
  box-sizing: border-box;
  text-align: center;
}

#marquee-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  overflow: hidden;
  background-color: #000;
  color: #0f0;
  font-family: monospace;
  font-size: 0.85rem;
  white-space: nowrap;
  border-bottom: 2px solid #0f0;
  padding: 6px 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

#marquee-text {
  display: inline-block;
  padding-left: 100%;
  animation: scroll-left 60s linear infinite;
}

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

#online-count {
  font-family: monospace;
  font-size: 0.95rem;
  color: #00ff00; /* bright green */
  background-color: #000;
  padding: 6px 12px;
  border: 1px solid #00ff00;
  border-radius: 4px;
  text-align: center;
  display: inline-block;
  margin-top: 4px;
  margin-bottom: 20px;
  box-shadow: 0 0 4px #00ff00;
  letter-spacing: 0.05em;
}

@keyframes flicker {
  0%   { opacity: 1; }
  45%  { opacity: 0.9; }
  50%  { opacity: 0.85; }
  55%  { opacity: 0.95; }
  60%  { opacity: 1; }
  100% { opacity: 1; }
}

#online-count {
  animation: flicker 1.5s infinite;
}


/* Container to center and limit width on desktop */
.container {
  width: 100%;
  max-width: 900px; /* wider on desktop */
  padding: 0 1rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.post-form, #posts {
  background: #111;
  border: 3px solid #0f0;
  border-radius: 12px;
  box-shadow: 0 0 15px #0f0aa0;
  width: 100%;
  padding: 1.5rem 1rem;
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
  color: #0f0;
  text-shadow:
    -1px -1px 0 #040,
    1px 1px 0 #080;
  margin-bottom: 2rem;
  box-sizing: border-box;
}

textarea, input[type=file] {
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  background: #000;
  border: 2px solid #0f0;
  color: #0f0;
  padding: 0.75rem;
  border-radius: 0;
  resize: vertical;
  outline: none;
  box-shadow: inset 0 0 8px #0f0;
  width: 95%;
  margin-bottom: 1rem;
}

button {
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  background: #0f0;
  border: none;
  color: #000;
  padding: 0.75rem 1rem;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  user-select: none;
  border-radius: 4px;
  box-shadow: 0 0 8px #0f0;
  transition: background-color 0.25s ease;
  width: fit-content;
}

button:hover,
button:focus {
  background: #0aa;
  color: #000;
  outline: none;
  box-shadow: 0 0 12px #0aaa;
}

#posts {
  padding: 0;
  list-style: none;
  width: 100%;
}

.post {
  background: #000;
  border: 2px solid #0f0;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 8px;
  box-shadow:
    inset 0 0 6px #0f0,
    0 0 6px #0a0;
  word-break: break-word;
}

.post p {
  font-size: 14px;
  margin: 0 0 10px 0;
  white-space: pre-wrap;
  user-select: text;
}

.post img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 2px solid #0f0;
  border-radius: 6px;
  margin-top: 10px;
  image-rendering: pixelated;
  box-shadow: 0 0 8px #0a0;
  overflow: hidden;
  word-break: break-word;
}

.votes {
  display: flex;
  gap: 12px;
  margin-top: 1rem;
}

.vote-btn {
  padding: 0.5rem 1rem;
  font-size: 14px;
  background: #0f0;
  border: none;
  color: #000;
  cursor: pointer;
  text-transform: uppercase;
  font-weight: 700;
  user-select: none;
  border-radius: 4px;
  box-shadow: 0 0 8px #0f0;
  transition: background-color 0.3s ease;
}

.vote-btn:hover,
.vote-btn:focus {
  background: #0aa;
  color: #000;
  outline: none;
  box-shadow: 0 0 12px #0aaa;
}

/* Responsive tweaks */
@media (max-width: 700px) {
  body {
    padding: 0.5rem;
  }

  h1 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
  }

  .post-form, #posts {
    padding: 1rem 0.75rem;
  }

  textarea, input[type="file"] {
    font-size: 12px;
    padding: 0.5rem;
  }

  button, .vote-btn {
    font-size: 12px;
    padding: 0.4rem 0.6rem;
  }
}


.trigger-apparo {
  background-color: #000;
  color: #00ffcc;
  border: 2px solid #00ffcc;
  box-shadow: 0 0 6px #00ffee;
  animation: apparo-glow 2s ease-in-out infinite;
}

.mode-toggle {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.mode-btn {
  font-family: monospace;
  font-size: 0.85rem;
  padding: 8px 14px;
  margin: 0 6px;
  border-radius: 4px;
  border: 2px solid #000;
  background-color: #cfd8cc;
  color: #000;
  box-shadow: 2px 2px 0 #444;
  cursor: pointer;
  transition: all 0.1s ease-in-out;
  width: 160px; /* fixed equal width */
  text-align: center;
}

.mode-btn:hover {
  background-color: #dfeedd;
  box-shadow: 1px 1px 0 #333;
  transform: translate(1px, 1px);
}

.mode-btn.active {
  background-color: #93e993;
  box-shadow: inset 1px 1px 0 #3a3;
  font-weight: bold;
  color: #000;
}

#mode-apparos {
  background-color: #eaffea;
  color: #008000;
  border-color: #008000;
}

#mode-nixtop {
  background-color: #ffeeee;
  color: #cc0000;
  border-color: #cc0000;
}

/* EXTREME GOTHIC NIXTOPAPPAROS MODE */
.nixtop-active body {
  background-color: #0a0000;
  color: #ff0033;
}

.nixtop-active h1 {
  color: #ff0033;
  text-shadow: 0 0 6px #ff0033;
}

.nixtop-active .post-form,
.nixtop-active #posts {
  background-color: #140000;
  border-color: #ff0033;
  box-shadow: 0 0 10px #ff0033aa;
  color: #ff0033;
  text-shadow: 0 0 2px #ff0033;
}

.nixtop-active .post {
  background: #110000;
  border: 2px solid #ff0033;
  box-shadow:
    inset 0 0 6px #ff0033aa,
    0 0 8px #ff0033aa;
}

.nixtop-active .post p {
  color: #ff0033;
  text-shadow: 0 0 2px #ff3366;
}

.nixtop-active .post img {
  border: 2px solid #ff0033;
  filter: grayscale(100%) contrast(140%);
  box-shadow: 0 0 6px #ff0033;
}

.nixtop-active textarea,
.nixtop-active input[type="file"] {
  background: #000;
  border: 2px solid #ff0033;
  color: #ff0033;
  box-shadow: inset 0 0 6px #ff0033;
}

.nixtop-active button,
.nixtop-active .vote-btn {
  background: #330000;
  color: #ff0033;
  border: 2px solid #ff0033;
  text-shadow: 0 0 2px #ff0033;
  box-shadow: 0 0 6px #ff0033;
}

.nixtop-active button:hover,
.nixtop-active .vote-btn:hover {
  background: #440000;
  color: #fff;
  box-shadow: 0 0 10px #ff3366;
}

.nixtop-active #marquee-container {
  background-color: #1a0000;
  border-color: #ff0033;
  color: #ff0033;
  box-shadow: 0 2px 10px #ff0033;
}

.nixtop-active #online-count {
  background-color: #2a0000;
  color: #ff0033;
  border-color: #ff0033;
  box-shadow: 0 0 6px #ff0033;
}

#draw-modal {
  display: none;
  position: fixed;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  background: black;
  padding: 10px;
  z-index: 1000;
  border: 2px solid green;
}

/* === DRAWING PAD === */

#draw-section {
  display: none;
  margin-top: 1rem;
  padding: 1rem;
  background: #000;
  border: 2px solid #0f0;
  box-shadow: 0 0 10px #0f0a;
  border-radius: 6px;
  width: 100%;
  max-width: 320px;
  box-sizing: border-box;
}

#draw-section canvas {
  width: 100%;
  max-width: 100%;
  height: auto;
  background: #000;
  border: 2px solid #0f0;
  image-rendering: pixelated;
  box-shadow: 0 0 8px #0f0;
}

.draw-buttons,
.draw-controls {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.draw-buttons button,
.draw-controls button {
  flex: 1;
  text-align: center;
}

@media (max-width: 480px) {
  #draw-section {
    max-width: 100%;
    padding: 0.75rem;
  }

  .draw-buttons,
  .draw-controls {
    flex-direction: column;
  }

  .draw-buttons button,
  .draw-controls button {
    width: 100%;
  }
}
.image-source-options {
  align-items: flex-start;
}

.image-source-options input[type="radio"] {
  transform: scale(1.2);
  margin-right: 6px;
}

.image-source-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 0.5rem;
}

.image-source-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  line-height: 1.2;
  margin: 2px 0;
}


#upload-section,
#draw-launch,
#draw-preview {
  width: 100%;
  margin-top: 4px;
}


#draw-preview {
  font-size: 0.7rem;
}

.nokia-button {
  display: inline-block;
  padding: 6px 12px;
  background-color: black;
  color: lime;
  font-family: 'Courier New', monospace;
  border: 2px solid lime;
  text-decoration: none;
  margin-top: 10px;
}
.nokia-button:hover {
  background-color: lime;
  color: black;
}
/* Two-column layout on desktop */
.two-column-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .two-column-layout {
    flex-direction: row;
    align-items: flex-start;
  }

  .post-column {
    flex: 1;
    position: sticky;
    top: 100px;
    align-self: flex-start;
  }

  .feed-column {
    flex: 2;
    max-height: 85vh;
    overflow-y: auto;
    padding-left: 2rem;
    scrollbar-color: #0f0 #000;
    scrollbar-width: thin;
  }

  .feed-column::-webkit-scrollbar {
    width: 8px;
  }

  .feed-column::-webkit-scrollbar-thumb {
    background-color: #0f0;
    border-radius: 10px;
  }

  .feed-column::-webkit-scrollbar-track {
    background: #000;
  }
}

.controls-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#apparos-near-btn {
  background: #222;
  color: #ff00ff;
  border: 2px solid #ff00ff;
  box-shadow: 0 0 6px #ff00ff;
}
#apparos-near-btn:hover {
  background: #ff00ff;
  color: black;
}

@keyframes border-glow {
  0% { border-color: #0f0; }
  50% { border-color: #0a0; }
  100% { border-color: #0f0; }
}

.post-form, .post, textarea {
  animation: border-glow 3s infinite;
}

@media (max-width: 700px) {
  .two-column-layout {
    flex-direction: column;
    gap: 1rem;
    padding: 0 0.5rem;
  }

  .post-form, #posts {
    padding: 1rem;
    font-size: 13px;
  }

  .mode-toggle {
    flex-direction: column;
    align-items: center;
  }

  .mode-btn {
    width: 100%;
  }
}
@media (max-width: 700px) {
  .container,
  .post-form,
  #posts {
    max-width: 100%;
  }
}
html {
  overflow-x: hidden;
}
.post-form {
  padding: 1rem 0.75rem;
}
body, h1, .post p {
  overflow-wrap: break-word;
  word-break: break-word;
}
.nixtop-active .image-source-options label,
.nixtop-active input[type="radio"],
.nixtop-active input[type="file"],
.nixtop-active button,
.nixtop-active textarea,
.nixtop-active .nokia-button {
  background: #1a0000 !important;
  color: #ff0033 !important;
  border-color: #ff0033 !important;
  box-shadow: 0 0 6px #ff0033 !important;
}

.nixtop-active .nokia-button:hover {
  background: #ff0033;
  color: black;
}
.post img {
  max-width: 100%;
  height: auto;
  display: block;
  word-break: break-word;
}

.feed-column {
  overflow-wrap: break-word;
  padding-left: 1rem; /* reduce from 2rem if needed */
}

.image-source-options button {
  margin-top: 4px;
  padding: 6px 10px;
}

textarea, input[type=file] {
  padding: 0.5rem;
  margin-bottom: 0.5rem;
}

.post-form {
  padding: 1rem 0.5rem;
}

.visibility-toggle {
  margin-top: 8px;
  font-size: 12px;
}

.visibility-toggle label {
  margin-right: 10px;
  cursor: pointer;
}

#room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  width: 100%;
  max-width: 800px;
  margin: 2rem auto;
}

.room-card {
  background: #000;
  border: 2px solid #0f0;
  color: #0f0;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.75rem;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 0 8px #0f0;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.room-card:hover {
  transform: scale(1.05);
  box-shadow: 0 0 12px #0f0;
}
