/* base.css — 全画面共通の基本スタイル(ログイン画面・アプリ骨格) */

:root {
  --felt: #1d5c43;          /* テーブルの緑 */
  --felt-dark: #12382b;
  --bg: #0f1d17;            /* 画面全体の背景 */
  --panel: #1a2b23;         /* パネル・カード台 */
  --panel-edge: #2c4437;
  --text: #eef4ef;
  --text-dim: #9db3a6;
  --gold: #d9a441;          /* アクセント(手番・勝者) */
  --danger: #d64545;
  --card-face: #f7f5ee;
  --card-red: #c0392b;
  --card-black: #22262a;
  --radius: 10px;
  font-size: 16px;
}

* { box-sizing: border-box; }

/* display指定を持つクラスと併用してもhidden属性を有効にする */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP",
    "Yu Gothic", system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 600; margin: 0; }

button { font-family: inherit; }

/* ---- ボタン ---- */

.btn {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}

.btn:hover { background: var(--panel-edge); }
.btn:active { transform: scale(0.98); }

.btn--primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #2a1f08;
  font-weight: 600;
}

.btn--primary:hover { background: #e5b558; }

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-dim);
  padding: 8px 10px;
}

.btn--ghost:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }

/* ---- ログイン画面 ---- */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
  background:
    radial-gradient(ellipse at 50% 30%, var(--felt) 0%, var(--felt-dark) 70%, var(--bg) 100%);
}

.login-box {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 14px;
  padding: 28px 24px;
}

.login-box h1 {
  font-size: 20px;
  text-align: center;
  margin-bottom: 20px;
}

.login-error {
  background: rgba(214, 69, 69, 0.15);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  color: #f2b8b8;
  font-size: 13px;
  padding: 8px 12px;
}

.form-note {
  color: var(--text-dim);
  font-size: 13px;
}

.form-row { margin-bottom: 14px; }

.form-row label span {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.form-row input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
}

.form-row input:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold);
}

.login-box .btn--primary { width: 100%; margin-top: 6px; }

/* ---- アプリ共通レイアウト ---- */

.app-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 50% 20%, var(--felt) 0%, var(--felt-dark) 75%, var(--bg) 100%);
  background-attachment: fixed;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.25);
}

.app-title { font-size: 17px; }

.app-header__right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.app-user {
  color: var(--text-dim);
  font-size: 13px;
  margin-right: 4px;
}

.logout-form { display: inline; margin: 0; }

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.view { flex: 1; }

/* ---- モード選択画面 ---- */

.view--select {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 24px 8px;
}

.select-heading { font-size: 18px; color: var(--text); }

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 280px));
  justify-content: center;
  gap: 16px;
  width: 100%;
}

.mode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 18px;
  background: var(--panel);
  border: 2px solid var(--panel-edge);
  border-radius: 14px;
  color: var(--text);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, transform 0.1s;
}

.mode-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.mode-card__icon { font-size: 40px; line-height: 1; }

.mode-card__name { font-size: 19px; font-weight: 600; }

.mode-card__desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

.select-settings {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.select-setting {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-dim);
}

.select-setting select {
  padding: 8px 10px;
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
}

/* ---- ゲーム画面(プレースホルダ) ---- */

.game-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 50vh;
  color: var(--text-dim);
}

/* ---- スマホ調整 ---- */

@media (max-width: 600px) {
  .app-header { padding: 8px 10px; }
  .app-title { font-size: 14px; white-space: nowrap; }
  .app-user { display: none; }
  .app-header__right .btn { padding: 8px 6px; font-size: 13px; white-space: nowrap; }
  .app-main { padding: 10px; }
}
