/**
 * DoristaTicket - スタイルシート
 * ドリームスター公式デザインを踏襲
 */

/* ========================================
   リセット & 基本設定
======================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 18px;
  font-weight: 400;
  color: #000;
  background: #7edaff;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* ========================================
   コンテナ
======================================== */
.container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #7edaff;
}

/* ========================================
   ヘッダー
======================================== */
.header {
  padding: 8px 16px;
  text-align: center;
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.logo {
  margin: 0;
  line-height: 0;
}

.logo img {
  max-width: 35%;
  height: auto;
}

.ticket-title {
  font-size: 6vw;
  font-weight: 700;
  text-shadow:
    /* 8方向の基本縁取り */
    -3px -3px 1px #fff,
     3px -3px 1px #fff,
    -3px  3px 1px #fff,
     3px  3px 1px #fff,
    -3px  0   1px #fff,
     3px  0   1px #fff,
     0  -3px  1px #fff,
     0   3px  1px #fff,
    /* 斜め45度の補間 */
    -2px -2px 1px #fff,
     2px -2px 1px #fff,
    -2px  2px 1px #fff,
     2px  2px 1px #fff,
    /* さらに細かい補間 */
    -2px -3px 1px #fff,
     2px -3px 1px #fff,
    -3px -2px 1px #fff,
     3px -2px 1px #fff,
    -2px  3px 1px #fff,
     2px  3px 1px #fff,
    -3px  2px 1px #fff,
     3px  2px 1px #fff,
    /* 16方向の補完 */
    -1px -3px 1px #fff,
     1px -3px 1px #fff,
    -3px -1px 1px #fff,
     3px -1px 1px #fff,
    -1px  3px 1px #fff,
     1px  3px 1px #fff,
    -3px  1px 1px #fff,
     3px  1px 1px #fff;
  color: #0075ff;
  text-align: center;
  margin-top: 8px;
  letter-spacing: 1px;
}

.logo-text {
  font-size: 28px;
  font-weight: 700;
  color: #004eb7;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* 現在時刻表示は削除 */

/* ========================================
   メイン
======================================== */
.main {
  flex: 1;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* ========================================
   ローディング
======================================== */
.loading {
  text-align: center;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #004eb7;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================
   エラー画面
======================================== */
.error-screen {
  text-align: center;
  padding: 40px 20px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  max-width: 400px;
  width: 100%;
}

.error-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.error-title {
  font-size: 24px;
  font-weight: 700;
  color: #ff0000;
  margin-bottom: 12px;
}

.error-message {
  font-size: 16px;
  color: #666;
  margin-bottom: 24px;
}

/* ========================================
   チケット
======================================== */
.ticket {
  width: 100%;
  max-width: 500px;
  background: #fff;
  border-radius: 16px;
  padding: 24px 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  animation: fadeIn 0.5s ease-in-out;
  position: relative;
  overflow: hidden;
}

/* 使用済みチケットのグレーアウト */
.ticket.ticket-used {
  background: #f5f5f5;
  opacity: 0.85;
}

.ticket.ticket-used .ticket-info {
  opacity: 0.6;
}

.ticket.ticket-used .info-value {
  color: #999;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ステータスバッジ - 帯デザイン */
.status-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  margin: -24px -20px 16px -20px;
  border-radius: 16px 16px 0 0;
  font-size: 24px;
  font-weight: 700;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.status-badge.unused {
  background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
  color: #ffffff;
  animation: pulse 2s ease-in-out infinite;
}

.status-badge.used {
  background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
  color: #ffffff;
}

.status-badge.expired {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: #ffffff;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  50% {
    opacity: 0.95;
    box-shadow: 0 4px 16px rgba(0, 212, 170, 0.3);
  }
}

.status-icon {
  font-size: 28px;
}

.status-text {
  font-size: 22px;
  letter-spacing: 1px;
}

/* チケット情報 */
.ticket-info {
  margin-bottom: 16px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #e0e0e0;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-size: 14px;
  font-weight: 500;
  color: #666;
}

.info-value {
  font-size: 16px;
  font-weight: 700;
  color: #000;
  text-align: right;
  word-break: break-word;
  max-width: 60%;
}

/* 使用情報 */
.used-info {
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(255, 0, 0, 0.05);
  border-radius: 8px;
  border-left: 4px solid #ff0000;
}

/* 期限切れメッセージ */
.expired-message {
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(255, 165, 0, 0.1);
  border-radius: 8px;
  border-left: 4px solid #ff6600;
}

.expired-message p {
  font-size: 14px;
  font-weight: 500;
  color: #ff0000;
  text-align: center;
}

/* スタッフ操作エリア */
.staff-area {
  margin-top: 20px;
  padding: 16px;
  background: linear-gradient(135deg, #fff5e6 0%, #ffe4cc 100%);
  border: 3px solid #ff0000;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.2);
  position: relative;
}

.staff-area::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 0, 0, 0.15),
    rgba(255, 0, 0, 0.15) 10px,
    transparent 10px,
    transparent 20px
  );
  border-radius: 12px;
  z-index: 0;
  pointer-events: none;
}

.staff-label {
  font-size: 16px;
  font-weight: 700;
  color: #ff0000;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.staff-label::before,
.staff-label::after {
  content: '⚠️';
  font-size: 18px;
}

/* ========================================
   ボタン
======================================== */
.btn {
  padding: 18px 0;
  font-size: 20px;
  font-weight: 700;
  border: none;
  border-radius: 100vh;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Noto Sans JP', sans-serif;
  width: 100%;
  max-width: 340px;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* 公式サイトスタイルのボタン */
.btn-use,
.btn-retry,
.btn-confirm {
  background: linear-gradient(to bottom, #ffae00, #ffc900);
  color: #fff;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
  text-shadow:
    -2px -2px 1px #f49a0d,
     2px -2px 1px #f49a0d,
    -2px  2px 1px #f49a0d,
     2px  2px 1px #f49a0d,
     0  -2px 1px #f49a0d,
     2px  0  1px #f49a0d,
     0   2px 1px #f49a0d,
    -2px  0  1px #f49a0d;
}

/* キラキラアニメーション */
.btn-use::before,
.btn-retry::before,
.btn-confirm::before {
  position: absolute;
  content: '';
  display: inline-block;
  top: -180px;
  left: 0;
  width: 30px;
  height: 100%;
  background-color: #fbfbfb;
  animation: btn_animation 2.5s ease-in-out infinite;
}

@keyframes btn_animation {
  0% { transform: scale(0) rotate(45deg); opacity: 0; }
  80% { transform: scale(0) rotate(45deg); opacity: 0.5; }
  81% { transform: scale(4) rotate(45deg); opacity: 1; }
  100% { transform: scale(50) rotate(45deg); opacity: 0; }
}

.btn-use:hover,
.btn-retry:hover,
.btn-confirm:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4);
}

.btn-use:active,
.btn-retry:active,
.btn-confirm:active {
  transform: translateY(0);
}

.btn-use:disabled,
.btn-confirm:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  text-shadow: none;
}

.btn-use:disabled::before,
.btn-confirm:disabled::before {
  display: none;
}

.btn-retry {
  margin-top: 16px;
}

/* ========================================
   モーダル
======================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.modal {
  background: #fff;
  border-radius: 16px;
  padding: 32px 24px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  position: relative;
}

.modal-title {
  font-size: 24px;
  font-weight: 700;
  color: #004eb7;
  text-align: center;
  margin-bottom: 12px;
}

.modal-description {
  font-size: 16px;
  color: #666;
  text-align: center;
  margin-bottom: 24px;
}

/* PIN入力 */
.pin-input-container {
  margin-bottom: 24px;
}

.pin-input {
  width: 100%;
  padding: 16px;
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 8px;
  border: 3px solid #004eb7;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
}

.pin-input:focus {
  outline: none;
  border-color: #0066ff;
  box-shadow: 0 0 0 4px rgba(0, 78, 183, 0.1);
}

.pin-input.error {
  border-color: #ff0000;
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

.pin-error {
  margin-bottom: 16px;
}

.error-text {
  color: #ff0000;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

/* モーダルボタン */
.modal-buttons {
  display: flex;
  gap: 12px;
}

.btn-cancel {
  background: #e0e0e0;
  color: #666;
  flex: 1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-cancel:hover {
  background: #d0d0d0;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.btn-cancel:active {
  transform: translateY(0);
}

.btn-confirm {
  flex: 1;
}

/* モーダルローディング */
.modal-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 16px;
}

.modal-loading .spinner {
  margin-bottom: 16px;
}

/* 成功アニメーション */
.success-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 200, 0, 0.97);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

.checkmark {
  font-size: 120px;
  color: #fff;
  animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.success-animation p {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin-top: 20px;
}

/* ========================================
   フッター
======================================== */
.footer {
  padding: 8px 16px;
  text-align: center;
  background: rgba(255, 255, 255, 0.3);
}

.copyright {
  font-size: 12px;
  color: #666;
}

/* ========================================
   レスポンシブ対応
======================================== */
/* 大画面用 */
@media (min-width: 641px) {
  .ticket-title {
    font-size: 38px;
  }
}

/* 小画面用 */
@media (max-width: 480px) {
  body {
    font-size: 16px;
  }

  .logo img {
    max-width: 40%;
  }

  .ticket-title {
    font-size: 7vw;
    margin-top: 6px;
  }

  .ticket {
    padding: 20px 16px;
  }

  .status-badge {
    padding: 14px 16px;
    margin: -20px -16px 12px -16px;
    font-size: 20px;
  }

  .status-icon {
    font-size: 24px;
  }

  .status-text {
    font-size: 20px;
  }

  .info-row {
    padding: 10px 0;
  }

  .info-label {
    font-size: 13px;
  }

  .info-value {
    font-size: 15px;
  }

  .btn {
    font-size: 15px;
    padding: 10px 0;
  }

  .staff-label {
    font-size: 14px;
  }

  .pin-input {
    font-size: 28px;
  }
}
