:root {
  font-family: 'Noto Sans JP', system-ui, sans-serif;
  color: #1a2a5e;
  background: #fff9f0;
  --navy: #1a2a5e;
  --blue: #2563eb;
  --cyan: #00bcd4;
  --yellow: #f5c400;
  --green: #059669;
  --green-bg: #e8f8f1;
  --light: #fff9f0;
  --muted: #7a8db0;
  --line: #e3e9f5;
  --shadow: 0 4px 20px rgba(26, 42, 94, .12);
  --login-accent: #1267d6;
  --login-accentDeep: #0a2e68;
  --login-surface: #eff6ff;
  --login-highlight: #19b2b1;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--light); color: var(--navy); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }

.top {
  min-height: 80px;
  padding: 0 max(20px, calc((100% - 1280px) / 2));
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  box-shadow: 0 4px 16px rgba(26, 42, 94, .3);
  position: sticky;
  top: 0;
  z-index: 10;
}
.top h1 { margin: 0; font-size: 22px; }
.top > a { color: #fff; font-weight: 800; }
.product-logo { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; min-width: 0; }
.product-logo-name { font-family: 'M PLUS Rounded 1c', sans-serif; font-size: 24px; font-weight: 900; color: var(--cyan); letter-spacing: .05em; }
.product-logo-name span { color: #fff; }
.product-logo-sub { font-size: 12px; color: #ffffffb3; border-left: 2px solid #ffffff44; padding-left: 14px; letter-spacing: .08em; }
.product-logo-mark { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 11px; background: linear-gradient(135deg, var(--login-highlight), var(--login-accent)); color: #fff; font-size: 18px; font-weight: 900; }
.product-logo strong, .product-logo small { display: block; }
.product-logo strong { font-size: 18px; line-height: 1.25; }
.product-logo small { margin-top: 2px; color: #ffffffbf; font-size: 11px; }

.top-actions { display: flex; align-items: center; gap: 10px; }
.top-action { display: inline-flex; align-items: center; gap: 6px; padding: 9px 15px; border-radius: 999px; background: #fff; color: var(--navy); font-size: 13px; font-weight: 800; text-decoration: none; box-shadow: 0 4px 12px rgba(0, 0, 0, .18); white-space: nowrap; }
.top-action:hover { background: var(--light); }
.admin-badge { color: #fff; background: #ffffff24; border: 1px solid #ffffff55; border-radius: 999px; padding: 8px 13px; font-size: 13px; font-weight: 800; }
.admin-hero { min-height: 148px; padding: 20px max(20px, calc((100% - 980px) / 2)); display: flex; justify-content: center; align-items: center; gap: 18px; overflow: hidden; position: relative; background: linear-gradient(135deg, #fff9f0, #e8f4ff); text-align: center; }
.admin-hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 18% 60%, #00bcd414, transparent 50%), radial-gradient(circle at 82% 60%, #f5c4001a, transparent 50%); pointer-events: none; }
.admin-hero > div, .hero-character { position: relative; z-index: 1; }
.admin-hero h1 { margin: 3px 0 5px; font-family: 'M PLUS Rounded 1c', sans-serif; font-size: clamp(22px, 3vw, 29px); line-height: 1.25; word-break: keep-all; line-break: strict; }
.admin-hero p { margin: 0; color: #5a6a8e; font-size: 13px; }
.eyebrow { color: var(--blue) !important; font-size: 11px !important; font-weight: 900; letter-spacing: .12em; }
.hero-character { height: 106px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .15)); animation: hero-bob 4s ease-in-out infinite; }
.hero-character-right { animation-delay: .7s; }
@keyframes hero-bob { 50% { transform: translateY(-8px); } }

.shell { max-width: 1280px; margin: 0 auto; padding: 26px 20px 40px; }
.notice { min-height: 20px; margin: 0 0 12px; color: #b45309; font-size: 13px; font-weight: 700; }
.tabs { display: flex; gap: 12px; margin-bottom: 18px; }
.tabs button { flex: 1; min-height: 60px; border: 2px solid transparent; border-radius: 16px; padding: 12px 18px; box-shadow: var(--shadow); font-family: 'M PLUS Rounded 1c', sans-serif; font-size: 16px; font-weight: 800; color: #fff; cursor: pointer; transition: transform .2s, opacity .2s; }
.tabs button:first-child { background: linear-gradient(135deg, var(--navy), var(--blue)); }
.tabs button:last-child { background: linear-gradient(135deg, #0d7a4f, #10b981); }
.tabs button[aria-selected=true] { border-color: #fff; transform: translateY(-3px); }
.tabs button[aria-selected=false] { opacity: .76; }
.tabs button:hover { opacity: 1; transform: translateY(-2px); }
.tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.search-wrap { position: relative; flex: 1; min-width: 250px; }
.search-wrap > span { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 17px; }
.tools input { width: 100%; padding: 13px 18px 13px 46px; border: 2px solid transparent; border-radius: 14px; background: #fff; color: var(--navy); box-shadow: var(--shadow); outline: none; }
.tools input:focus { border-color: var(--cyan); }
.action, .card button { border: 0; cursor: pointer; font-weight: 800; }
.filter-action { padding: 12px 16px; border: 2px solid var(--line); border-radius: 14px; background: #fff; color: var(--navy); box-shadow: var(--shadow); white-space: nowrap; }
.filter-action.primary { border-color: var(--green); background: var(--green-bg); color: var(--green); }
.group { margin: 0 0 30px; }
.group h2 { display: inline-flex; align-items: center; margin: 0 0 14px; padding: 7px 16px 7px 13px; border-radius: 0 12px 12px 0; background: linear-gradient(135deg, var(--navy), var(--blue)); box-shadow: 0 4px 12px rgba(26, 42, 94, .2); color: #fff; font-family: 'M PLUS Rounded 1c', sans-serif; font-size: 14px; font-weight: 900; position: relative; }
.group h2::before { content: ''; position: absolute; left: -6px; top: 0; bottom: 0; width: 6px; border-radius: 3px 0 0 3px; background: var(--cyan); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 14px; }
.card { min-height: 225px; overflow: hidden; position: relative; border: 2px solid transparent; border-radius: 16px; background: #fff; box-shadow: 0 3px 14px rgba(26, 42, 94, .1); padding: 0 12px 14px; transition: transform .2s, box-shadow .2s, border-color .2s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(26, 42, 94, .18); border-color: var(--cyan); }
.card-visual { height: 106px; margin: 0 -12px 10px; position: relative; display: grid; place-items: center; overflow: hidden; background: linear-gradient(135deg, var(--navy), var(--blue)); }
.card-visual::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 80% 15%, #00bcd480, transparent 28%), linear-gradient(180deg, #0000001a, transparent 55%, #00000022); }
.card-number, .card-state, .card-play { position: absolute; z-index: 1; }
.card-number { left: 9px; top: 8px; border-radius: 20px; padding: 2px 7px; background: #0006; color: #fff; font-family: 'M PLUS Rounded 1c', sans-serif; font-size: 10px; font-weight: 800; }
.card-state { right: 8px; top: 8px; border-radius: 10px; padding: 2px 8px; background: #ffffff38; color: #fff; font-size: 9px; font-weight: 800; }
.card-state.is-ready { background: var(--green); }
.card-play { display: grid; place-items: center; width: 42px; height: 42px; border: 3px solid #fffd; border-radius: 50%; background: #ffffff38; color: #fff; font-size: 14px; padding-left: 2px; }
.tag { display: block; color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card h3 { margin: 5px 0 8px; color: var(--navy); font-size: 14px; line-height: 1.55; }
.card a { display: inline-flex; align-items: center; justify-content: center; margin-top: 8px; padding: 8px 10px; border-radius: 9px; background: linear-gradient(135deg, var(--cyan), var(--blue)); color: #fff; text-decoration: none; font-size: 12px; font-weight: 800; }
.card .pending { display: inline-block; margin-top: 8px; color: var(--muted); font-size: 11px; }
.title-row { display: flex; gap: 5px; align-items: flex-start; }
.title-row h3 { flex: 1; }
.card .pencil { margin: 2px 0 0; padding: 2px 6px; border-radius: 7px; background: transparent; color: var(--blue); font-size: 17px; }
.pencil:focus-visible, .edit-trigger:focus-visible, .add-trigger:focus-visible, .card button:focus-visible, .tabs button:focus-visible, .filter-action:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.edit-trigger { width: 100%; margin-top: 7px; padding: 8px 10px; border: 2px solid #dce8ff; border-radius: 10px; background: #f8fbff; color: var(--blue); font-size: 12px; }
.edit-trigger:hover { border-color: var(--cyan); background: #effbff; }
.card-editor { display: grid; gap: 8px; margin: 11px -2px 0; padding: 11px; border-top: 2px dashed #dce8ff; border-radius: 10px; background: #fafcff; }
.field-label { display: grid; gap: 5px; color: #5a6a8e; font-size: 11px; font-weight: 800; }
.card input, .card select { width: 100%; min-width: 0; padding: 8px 9px; border: 2px solid #e0e8f8; border-radius: 8px; background: #fff; color: var(--navy); outline: none; font-size: 12px; }
.card input:focus, .card select:focus { border-color: var(--cyan); }
.compact { padding: 7px 9px !important; border-radius: 8px !important; font-size: 12px !important; }
.secondary { background: #e8edf8 !important; color: var(--blue) !important; }
.primary { background: linear-gradient(135deg, var(--blue), #1d4ed8) !important; color: #fff !important; }
.danger { background: #fff1f2 !important; color: #be123c !important; }
.url-control { display: grid; gap: 7px; }
.add-group { margin-top: 4px; }
.add-card { min-height: 225px; border: 2px dashed #9bc5e6; display: flex; flex-direction: column; justify-content: center; background: linear-gradient(145deg, #fff, #f1f8ff); box-shadow: none; }
.add-card:hover { border-color: var(--blue); }
.add-card .card-visual { display: none; }
.add-card h3 { font-family: 'M PLUS Rounded 1c', sans-serif; font-size: 17px; }
.add-trigger { width: 100%; margin-top: 8px; padding: 12px; border: 0; border-radius: 11px; background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; font-weight: 900; }
.empty { margin: 0; padding: 28px; border-radius: 16px; background: #fff; color: var(--muted); box-shadow: var(--shadow); }

/* The login page intentionally uses its own product presentation; never hide it. */
.login-entry { position: relative; overflow: hidden; max-width: 560px; margin: 64px auto; padding: 0 38px 34px; border: 1px solid #d3e4fb; border-radius: 22px; background: linear-gradient(145deg, #fff 0%, var(--login-surface) 150%); box-shadow: 0 18px 45px #0d35731f; }
.login-entry::after { content: ''; position: absolute; right: -115px; bottom: -130px; width: 220px; height: 220px; border-radius: 50%; background: var(--login-highlight); opacity: .1; }
.login-visual { position: relative; height: 106px; margin: 0 -38px 30px; display: flex; align-items: center; gap: 9px; overflow: hidden; border-radius: 22px 22px 0 0; padding: 0 34px; background: linear-gradient(135deg, var(--login-accentDeep), var(--login-accent)); }
.login-visual::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 78% 24%, #fff7 0 2px, transparent 3px) 0 0 / 24px 24px; opacity: .45; }
.login-visual span:not(.login-play) { display: block; width: 55px; height: 7px; border-radius: 9px; background: #fff7; }
.login-visual span:last-child { width: 88px; }
.login-play { position: relative; z-index: 1; display: grid; place-items: center; width: 42px; height: 42px; border: 2px solid #fff; border-radius: 50%; color: #fff; font-size: 15px; padding-left: 2px; }
.login-entry .eyebrow, .login-entry h2, .login-entry p, .login-entry .action, .login-entry .back-link { position: relative; z-index: 1; }
.login-entry h2 { margin: 8px 0 12px; color: var(--login-accentDeep); font-size: 29px; line-height: 1.35; }
.login-entry p { line-height: 1.7; }
.login-entry .action { display: inline-block; margin-top: 12px; padding: 11px 15px; border-radius: 10px; text-decoration: none; }
.login-entry .back-link { display: block; margin-top: 18px; color: var(--login-accentDeep); }

@media (max-width: 700px) {
  .top { min-height: 64px; padding: 0 14px; }
  .product-logo-name { font-size: 21px; }
  .product-logo-sub { display: none; }
  .admin-badge { padding: 7px 9px; font-size: 11px; }
  .top-actions { gap: 7px; }
  .top-action { padding: 8px 11px; font-size: 12px; }
  .admin-hero { min-height: 120px; padding: 13px; }
  .hero-character { height: 68px; }
  .admin-hero h1 { font-size: 21px; }
  .admin-hero p:not(.eyebrow) { font-size: 11px; }
  .shell { padding: 18px 12px 36px; }
  .tabs { flex-direction: column; gap: 10px; }
  .tabs button { min-height: 53px; }
  .tools { gap: 10px; }
  .search-wrap { min-width: 100%; }
  .filter-action { width: 100%; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { min-height: 216px; }
  .card-visual { height: 92px; }
  .card h3 { font-size: 13px; }
  .login-entry { margin: 28px 0; padding: 0 24px 26px; }
  .login-visual { height: 88px; margin: 0 -24px 24px; padding: 0 24px; }
  .login-entry h2 { font-size: 24px; }
}

@media (max-width: 380px) {
  .cards { grid-template-columns: 1fr; }
  .hero-character { display: none; }
}
