/* Mini games shared styles */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", Roboto, sans-serif;
  background: #f8fafc;
  color: #111827;
  line-height: 1.6;
}

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

header.site-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-weight: 800;
  font-size: 1.25rem;
  color: #111827;
}

.nav-links a {
  font-size: 0.95rem;
  color: #4b5563;
  margin-left: 1rem;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

h1 {
  font-size: 1.75rem;
  margin: 0 0 0.5rem;
}

.subtitle {
  color: #6b7280;
  margin-bottom: 1.5rem;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.game-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 1.25rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.game-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

.game-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.game-card p {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: #4b5563;
}

.play-btn {
  display: inline-block;
  background: #2563eb;
  color: #ffffff;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}

.play-btn:hover {
  background: #1d4ed8;
}

.game-container {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
}

.game-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.game-desc {
  color: #6b7280;
  margin-bottom: 1.5rem;
}

.btn {
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin: 0.25rem;
}

.btn:hover {
  background: #1d4ed8;
}

.btn.secondary {
  background: #e5e7eb;
  color: #111827;
}

.btn.secondary:hover {
  background: #d1d5db;
}

.result-box {
  margin: 1.5rem 0;
  padding: 1rem;
  background: #f1f5f9;
  border-radius: 0.75rem;
  min-height: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 600;
}

.stats {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #4b5563;
}

.back-link {
  display: inline-block;
  margin-top: 2rem;
  color: #4b5563;
}

footer {
  text-align: center;
  padding: 2rem 1rem;
  color: #9ca3af;
  font-size: 0.85rem;
}

.dice-area,
.choice-area,
.board {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.coin,
.die,
.choice {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 1rem;
  font-size: 2rem;
  user-select: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.coin:hover,
.die:hover,
.choice:hover {
  transform: scale(1.05);
  border-color: #2563eb;
}

.coin.heads {
  background: #fde047;
}

.coin.tails {
  background: #e5e7eb;
}

.die {
  font-weight: 800;
  color: #111827;
}

.board {
  display: grid;
  grid-template-columns: repeat(3, 90px);
  gap: 0.5rem;
  margin: 1.5rem auto;
  width: fit-content;
}

.cell {
  width: 90px;
  height: 90px;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 0.75rem;
  font-size: 2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.cell:hover {
  background: #eff6ff;
}

.cell.taken {
  cursor: default;
}

input.guess-input {
  padding: 0.75rem;
  font-size: 1.25rem;
  width: 160px;
  text-align: center;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

input.guess-input:focus {
  outline: none;
  border-color: #2563eb;
}

.history {
  margin-top: 1.5rem;
  text-align: left;
}

.history li {
  padding: 0.35rem 0;
  border-bottom: 1px solid #f3f4f6;
}
