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

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0f0f1a;
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  text-align: center;
  padding: 60px 20px 40px;
  position: relative;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 2px;
}

.subtitle {
  margin-top: 8px;
  font-size: 1.1rem;
  color: #888;
}

main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 60px;
  width: 100%;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.game-card {
  background: #1a1a2e;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid #2a2a40;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border-color: #4a4a6a;
}

.card-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #12121f;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-info {
  padding: 20px;
}

.card-info h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 8px;
}

.card-info p {
  font-size: 0.9rem;
  color: #999;
  line-height: 1.5;
  word-break: keep-all;
}

/* 인증 영역 */
.auth-area {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
}

.logo-link {
  text-decoration: none;
  color: inherit;
}

.btn-auth {
  display: inline-block;
  padding: 8px 20px;
  border: 1px solid #555;
  background: transparent;
  color: #ccc;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-auth:hover {
  border-color: #aaa;
  color: #fff;
}

.btn-signup {
  background: #e2b04a;
  border-color: #e2b04a;
  color: #111;
}

.btn-signup:hover {
  background: #d4a03a;
}

.user-info {
  color: #e2b04a;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-logout {
  padding: 6px 14px;
  border: 1px solid #555;
  background: transparent;
  color: #999;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-logout:hover {
  color: #fff;
  border-color: #aaa;
}

/* 인증 페이지 */
.auth-page {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
}

.auth-card {
  background: #1e1e2e;
  border-radius: 12px;
  padding: 40px;
  width: 90%;
  max-width: 380px;
}

.auth-card h2 {
  color: #fff;
  margin-bottom: 20px;
  text-align: center;
}

.auth-card input {
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #111;
  color: #fff;
  font-size: 0.95rem;
  box-sizing: border-box;
}

.auth-card input:focus {
  outline: none;
  border-color: #e2b04a;
}

.auth-error {
  color: #e74c3c;
  font-size: 0.85rem;
  min-height: 20px;
  text-align: center;
}

.btn-submit {
  width: 100%;
  padding: 12px;
  background: #e2b04a;
  border: none;
  border-radius: 8px;
  color: #111;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  margin-top: 5px;
}

.btn-submit:hover {
  background: #d4a03a;
}

.auth-switch {
  text-align: center;
  color: #666;
  font-size: 0.85rem;
  margin-top: 15px;
}

.auth-switch a {
  color: #e2b04a;
  cursor: pointer;
}

.input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.input-row input {
  flex: 1;
  margin-bottom: 0;
}

.btn-send-code {
  padding: 12px 16px;
  background: #e2b04a;
  border: none;
  border-radius: 8px;
  color: #111;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
}

.btn-send-code:hover {
  background: #d4a03a;
}

.btn-send-code:disabled {
  background: #555;
  cursor: not-allowed;
}

.auth-timer {
  text-align: center;
  color: #e2b04a;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.verified-email {
  text-align: center;
  color: #e2b04a;
  font-size: 0.95rem;
  margin-bottom: 16px;
  padding: 10px;
  background: rgba(226, 176, 74, 0.1);
  border-radius: 8px;
}

footer {
  text-align: center;
  padding: 30px 20px;
  color: #555;
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  header {
    padding: 40px 20px 30px;
  }

  header h1 {
    font-size: 1.8rem;
  }

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