body {
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  background: #1e1e1e;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

#welcome-text {
  font-size: 2.2rem;
  font-weight: bold;
  margin-top: 30px;
  text-align: center;
  opacity: 0;
  transform: translateX(-100%);
  animation: slideInCenter 1.2s ease-out forwards;
  line-height: 1.3;
  padding: 0 10px;
  word-break: break-word;
}

#subtitle {
  font-size: 1.3rem;
  margin: 10px 0 25px;
  color: white;
  font-weight: 600;
  opacity: 0;
  transform: translateX(-100%);
  animation: slideInCenter 1.2s ease-out forwards;
  animation-delay: 0.4s;
  animation-fill-mode: forwards;
}

@keyframes slideInCenter {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

#name-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

#name-entry input[type="text"] {
  padding: 10px;
  font-size: 1rem;
  border: 2px solid #ccc;
  border-radius: 6px;
  width: 250px;
  transition: border 0.3s;
}

#name-entry input[type="text"]:focus {
  border-color: #007bff;
  outline: none;
}

.toggle-btn {
  padding: 8px 16px;
  background: #f0f0f0;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  color: #333;
  user-select: none;
  border: none;
  transition: background 0.3s ease;
}

.toggle-btn:hover {
  background: #e0e0e0;
}

.round-toggle {
  display: flex;
  gap: 10px;
  margin: 10px 0;
}

.round-toggle input[type="radio"] {
  display: none;
}

.round-toggle label {
  padding: 8px 16px;
  background: #f0f0f0;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  color: #333;
  user-select: none;
}

.round-toggle input[type="radio"]:checked + label {
  background: #007bff;
  color: white;
}

button {
  padding: 12px 30px;
  font-size: 1rem;
  border: none;
  background-color: #f0f0f0;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  color: #007bff;
  transition: background 0.3s ease;
}

button:hover {
  background-color: #e0e0e0;
}

#game {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#board {
  display: grid;
  grid-template-columns: repeat(3, 90px);
  grid-template-rows: repeat(3, 90px);
  gap: 5px;
  margin: 15px 0;
}

.cell {
  width: 90px;
  height: 90px;
  background: white;
  color: black;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
}

.cell[data-player="X"] {
  color: red;
}

.cell[data-player="O"] {
  color: blue;
}

#winMessage {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 10px 0;
}

.fade-text {
  animation: fadeInOut 3s ease-in-out;
}

@keyframes fadeInOut {
  0% { opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { opacity: 0; }
}

#footer {
  margin-top: auto;
  padding: 20px 0;
  font-size: 0.9rem;
  color: #aaa;
}

/* Responsive tweak */
/* Responsive tweaks for small screens */
@media (max-width: 600px), (max-height: 700px) {
  #board {
    grid-template-columns: repeat(3, 75px);
    grid-template-rows: repeat(3, 75px);
  }

  .cell {
    width: 75px;
    height: 75px;
    font-size: 2rem;
  }

  button {
    padding: 10px 20px;
  }

  #welcome-text {
    font-size: 1.8rem;
    margin-top: 20px;
  }

  #subtitle {
    font-size: 1.1rem;
    margin: 8px 0 20px;
  }
}

#startBtn {
  margin-top: 10px;
}

#resetBtn {
  display: none;
}

.round-toggle {
  justify-content: center;
}

#floating-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.floating-symbol {
  position: absolute;
  font-size: 2rem;
  font-weight: bold;
  opacity: 0.07;
  color: white;
  animation: float infinite linear;
  user-select: none;
}

@keyframes float {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.1;
  }
  100% {
    transform: translateY(-10vh) rotate(360deg);
    opacity: 0;
  }
}

/* Utility: make the HTML `hidden` attribute actually hide elements */
[hidden] { display: none !important; }

/* Collapsed chat: hide body, keep header visible */
#chat.collapsed #chat-messages,
#chat.collapsed #chat-input-row { display: none; }

/* Make the header a flex row with a button on the right */
#chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Toggle button */
#chat-toggle {
  border: none;
  background: transparent;
  color: #ddd;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}
#chat-toggle:hover { background: rgba(255,255,255,0.08); }

#chat-toggle:focus {
  outline: none;
  box-shadow: none;
}

/* Accessible custom focus for keyboard users */
#chat-toggle:focus-visible {
  outline: 2px solid rgba(0, 170, 255, 0.6);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Firefox inner focus removal on <button> */
#chat-toggle::-moz-focus-inner {
  border: 0;
}

#chat:focus-within {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 170, 255, 0.2);
  border-radius: 12px;
}

#chat.unread {
  animation: chatGlow 1.25s ease-in-out 3;
}

@keyframes chatGlow {
  0% {
    box-shadow:
      0 0 0 1px #444,
      0 0 0 0 rgba(0, 170, 255, 0);
  }
  50% {
    box-shadow:
      0 0 0 1px #444,
      0 0 24px 6px rgba(0, 170, 255, 0.35);
  }
  100% {
    box-shadow:
      0 0 0 1px #444,
      0 0 0 0 rgba(0, 170, 255, 0);
  }
}

#chat.collapsed #chat-messages,
#chat.collapsed #chat-input-row { display: none; }


/* --- Chat --- */
#chat {
  position: fixed;
  left: 20px;
  bottom: 20px;
  width: 260px;
  max-height: 40vh;
  display: flex;
  flex-direction: column;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  z-index: 10;
}

#chat-header {
  padding: 8px 10px;
  font-weight: 600;
  border-bottom: 1px solid #444;
}

#chat-messages {
  padding: 8px;
  overflow-y: auto;
  flex: 1;
  font-size: 0.92rem;
}

.message {
  margin: 6px 0;
  display: flex;
}

.message .bubble {
  padding: 6px 8px;
  background: #3a3a3a;
  border-radius: 10px;
  max-width: 80%;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.message.self { justify-content: flex-end; }
.message.self .bubble { background: #007bff; color: #fff; }

#chat-input-row {
  display: flex;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid #444;
}

#chat-input {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #555;
  background: #1e1e1e;
  color: #fff;
}

#chat-send {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: #f0f0f0;
  color: #007bff;
  font-weight: 600;
  cursor: pointer;
}
#chat-send:hover { background: #e0e0e0; }

@media (max-width: 600px) {
  #chat { width: 90vw; left: 5vw; bottom: 12px; }
}

/* Social bar */
#social-bar {
  margin: 18px 0 8px;
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  z-index: 1;
}

.social-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  color: #c9f6ff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(100,255,255,0.08);
  text-decoration: none;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}

.social-btn:hover {
  transform: translateY(-2px);
  background: #303a3a;
  border-color: rgba(100,255,255,0.35);
  box-shadow: 0 12px 28px rgba(0,0,0,0.45), 0 0 24px rgba(0,255,255,0.25);
  color: #e9fbff;
}

.social-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}
/* mobile */
@media (max-width: 600px) {
  #social-bar { gap: 10px; }
  .social-btn { width: 40px; height: 40px; }
  .social-btn svg { width: 20px; height: 20px; }
}
.social-btn.discord:hover {
  border-color: #5865F2;
  box-shadow: 0 12px 28px rgba(0,0,0,0.45),
              0 0 24px rgba(88,101,242,0.35);
}

.social-btn:focus-visible {
  outline: 2px solid rgba(0,170,255,0.7);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .social-btn, .social-btn:hover {
    transform: none;
    transition: none;
  }
}
.social-btn:active { transform: translateY(0); box-shadow: 0 8px 20px rgba(0,0,0,.4); }
.social-btn { -webkit-tap-highlight-color: rgba(255,255,255,0); }

/* Hide socials when the game container is visible (CSS-only) */
#game:not([hidden]) ~ #social-bar { display: none !important; }

/* ----- Hologram Rules Panel ----- */
.holo-panel {
  position: relative;
  margin: 56px auto 0;
  width: min(760px, 92vw);
  padding: 16px 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(100, 255, 255, 0.35);
  background:
    radial-gradient(120% 180% at 10% 0%, rgba(0,255,255,0.08), transparent 55%),
    radial-gradient(120% 180% at 100% 100%, rgba(0,200,255,0.08), transparent 55%),
    #121212;
  box-shadow:
    inset 0 0 0 1px rgba(100,255,255,0.12),
    0 16px 40px rgba(0,0,0,0.45),
    0 0 70px -30px rgba(0,255,255,0.35);
  overflow: hidden;
  color: #e9fbff;
}

/* scanline sheen */
.holo-panel::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,255,255,0.08) 0,
    rgba(0,255,255,0.08) 2px,
    transparent 3px,
    transparent 6px
  );
  animation: holo-scan 6s linear infinite;
  mix-blend-mode: screen;
  opacity: 0.32;
  pointer-events: none;
}

@keyframes holo-scan {
  from { transform: translateY(-100%); }
  to   { transform: translateY(100%); }
}

/* soft inner glow */
.holo-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 48px rgba(0,255,255,0.14);
  pointer-events: none;
}

.holo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.holo-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #c9f6ff;
  text-shadow: 0 0 12px rgba(0,255,255,0.25);
}

/* tabs */
.holo-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.holo-tab {
  background: transparent;
  border: 1px solid rgba(100,255,255,0.28);
  color: #c9f6ff;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  backdrop-filter: blur(4px);
  transition: background 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.holo-tab:hover { background: rgba(0,255,255,0.10); }
.holo-tab.is-active {
  background: rgba(0,255,255,0.16);
  border-color: rgba(100,255,255,0.55);
  box-shadow: inset 0 0 12px rgba(0,255,255,0.28);
}

.holo-body { font-size: 0.95rem; }
.holo-body ul { margin: 8px 0 0 18px; }
.holo-body li { margin: 4px 0; opacity: 0.95; }

/* tab panes */
.pane { display: none; }
.pane.is-active { display: block; }
.pane[hidden] { display: none !important; }

/* holo - corners */
.holo-corners::before,
.holo-corners::after { display: none !important; }

/* mobile tweaks */
@media (max-width: 600px) {
.holo-panel { margin-top: calc(36px + env(safe-area-inset-top)); }
  .holo-tabs { gap: 4px; }
  .holo-tab { padding: 5px 8px; font-size: 0.85rem; }
}

/* accessibility: reduce motion */
@media (prefers-reduced-motion: reduce) {
  .holo-panel::before { animation: none; opacity: 0.15; }
}



