<script setup lang="ts">
import { useI18n } from '@/composables/useI18n'

const emit = defineEmits<{
  resume: []
  saveLoad: []
  settings: []
  quitToMenu: []
}>()

const { t } = useI18n()
</script>

<template>
  <div class="pause-overlay" @click.self="emit('resume')" @keydown.escape="emit('resume')">
    <div class="pause-menu">
      <h2 class="pause-title">{{ t('ui.paused') }}</h2>

      <div class="pause-actions">
        <button class="pause-btn primary" @click="emit('resume')">{{ t('ui.pauseResume') }}</button>
        <button class="pause-btn" @click="emit('saveLoad')">{{ t('ui.saveLoad') }}</button>
        <button class="pause-btn" @click="emit('settings')">{{ t('ui.settings') }}</button>
        <button class="pause-btn" @click="emit('quitToMenu')">{{ t('ui.quitToMenu') }}</button>
      </div>

      <div class="pause-hint">{{ t('ui.pauseHint') }}</div>
    </div>
  </div>
</template>

<style scoped>
.pause-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.pause-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.pause-title {
  font-size: 32px;
  font-weight: 400;
  letter-spacing: 6px;
  color: #c9a84c;
}

.pause-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 280px;
}

.pause-btn {
  padding: 14px 32px;
  font-size: 16px;
  color: #ccc;
  background: rgba(201, 168, 76, 0.06);
  border: 1px solid rgba(201, 168, 76, 0.15);
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 2px;
  transition: background 0.15s, color 0.15s;
}

.pause-btn:hover {
  background: rgba(201, 168, 76, 0.12);
  color: #fff;
}

.pause-btn.primary {
  color: #c9a84c;
  background: rgba(201, 168, 76, 0.12);
  border-color: rgba(201, 168, 76, 0.25);
}

.pause-btn:focus-visible {
  outline: 2px solid #c9a84c;
  outline-offset: 2px;
}

.pause-hint {
  font-size: 12px;
  color: #666;
}
</style>
