* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #ffffff;
  color: #000000;
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  text-align: center;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: 44px;
  margin: 0 0 8px;
}

.panel {
  background: #ffffff;
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

.small {
  color: #000000;
  line-height: 1.5;
}

.controls,
.attackBox {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin: 14px 0;
}

button,
select,
input {
  border-radius: 10px;
  border: 1px solid #000000;
  padding: 10px 12px;
  font-size: 16px;
}

button {
  cursor: pointer;
  background: #ffffff;
  font-weight: 700;
}

button:hover {
  filter: brightness(0.96);
}

.primary {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

.danger {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

.hidden {
  display: none;
}

.status {
  min-height: 24px;
  font-weight: 700;
  color: #000000;
}

.grid {
  display: grid;
  grid-template-columns: repeat(7, 42px);
  gap: 4px;
  overflow-x: auto;
  padding: 8px 0;
  position: relative;
}

.intro-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.intro-card {
  border: 1px solid #000000;
  border-radius: 16px;
  padding: 20px;
  background: #ffffff;
}

.intro-card h3 {
  margin-top: 0;
}

.join-box {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.join-box input {
  flex: 1 1 220px;
}

/* Explosion emoji overlay when a hit occurs */
.emoji-explosion {
  position: absolute;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.2);
  opacity: 1;
  font-size: 28px;
  transition:
    transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 360ms ease;
  will-change: transform, opacity;
  z-index: 20;
}
.emoji-explosion.pop {
  transform: translate(-50%, -50%) scale(1.6) rotate(8deg);
  opacity: 0;
}

.cell {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid #000000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  background: #ffffff;
  user-select: none;
}

.cell .cell-main {
  font-size: 14px;
}

.axis-label {
  position: absolute;
  font-size: 10px;
  color: #000000;
  opacity: 0.9;
}

.x-label {
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
}

.y-label {
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
}

.coord-label {
  background: #000000;
  color: #ffffff;
  font-weight: 700;
}

.clickable {
  cursor: pointer;
}

.clickable:hover {
  outline: 3px solid #000000;
}

.canoe {
  background: #000000;
  color: #ffffff;
}

.preview {
  background: #ffffff;
  border: 1px solid #000000;
}

.hit {
  background: #000000;
  color: #ffffff;
  font-weight: 900;
}

.miss {
  background: #ffffff;
  color: #c92b2b;
  font-weight: 900;
}

.xspot {
  background: #000000;
  color: #ffffff;
  font-weight: 900;
}

.treasure {
  background: #d4a017;
  color: #000000;
  font-weight: 900;
}

.chest {
  background: #7b3f00;
  color: #ffffff;
  font-weight: 900;
}

.sunk {
  background: #000000;
  color: #ffffff;
}

.boards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.share-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 10px 0 8px;
}

.share-row input {
  flex: 1 1 240px;
}

.access-code {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

@media (max-width: 900px) {
  .boards {
    grid-template-columns: 1fr;
  }

  .intro-columns {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 34px;
  }
}
