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

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: #1b2735;
  background: linear-gradient(160deg, #1b2735 0%, #090a0f 100%);
  color: #f7f7f7;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 12px;
  -webkit-tap-highlight-color: transparent;
}

.wrap { width: 100%; max-width: 820px; }

h1 { text-align: center; letter-spacing: 2px; margin-bottom: 8px; }

.intro {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.intro .logo {
  height: 200px;
  width: auto;
  max-height: 200px;
  flex: 0 0 auto;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}

.intro-text {
  flex: 1 1 auto;
}

.intro-text p {
  font-size: 0.92rem;
  line-height: 1.5;
  color: #c4d3e0;
}

.re-logo {
  height: 20px;
  width: auto;
  display:block;
  margin:auto;
  margin-top: 50px;
}

.intro-text strong { color: #ff8080; }

.panel, .overlay-box, .board {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

#nickname-screen {
  max-width: 380px;
  margin: 40px auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

#nickname {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 1rem;
  text-align: center;
}

#nickname:focus { outline: 2px solid #00aeef; }

button {
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background: #00aeef;
  color: #12232e;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

button:hover { background: #8ae3ff; }

.error { color: #ff8080; font-size: 0.9rem; }

.hud {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 0.95rem;
  color: #cfe8ff;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: linear-gradient(#1c2a4a 0%, #3a4a6b 70%, #6b5b7a 70%, #3c3f46 100%);
  touch-action: manipulation;
}

.hint { text-align: center; font-size: 0.85rem; color: #9db8cc; margin: 8px 0 16px; }

.boards {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 24px 0 16px;
}

.board {
  flex: 1 1 240px;
  padding: 12px 16px;
}

.board h2 { font-size: 1rem; margin-bottom: 8px; color: #00aeef; }

[hidden] { display: none !important; }

.board ol { padding-left: 20px; font-size: 0.9rem; line-height: 1.6; }

.board li span.score { float: right; color: #ffd76e; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.overlay.visible { display: flex; }

.overlay-box {
  padding: 32px 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #1b2735;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

#change-nickname { margin: 0 auto 8px; display: block; }

.game-over-title {
  font-size: 2.4rem;
  color: #e74c3c;
  letter-spacing: 2px;
  text-transform: uppercase;
    line-height: 1rem;
}

.game-over-subtitle {
  font-size: 1rem;
  color: #c4d3e0;
  font-style: italic;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.btn-link {
  display: block;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background: #00aeef;
  color: #12232e;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn-link:hover { background: #8ae3ff; }